/* // $Id: //guest/julian_hyde/mondrian/src/main/mondrian/rolap/RolapMember.java#1 $ // This software is subject to the terms of the Common Public License // Agreement, available at the following URL: // http://www.opensource.org/licenses/cpl.html. // (C) Copyright 2001-2002 Kana Software, Inc. and others. // All Rights Reserved. // You must accept the terms of that agreement to use this software. // // jhyde, 10 August, 2001 */ package mondrian.rolap; import mondrian.olap.*; import mondrian.util.Format; /** * todo: * * @author jhyde * @since 10 August, 2001 * @version $Id: //guest/julian_hyde/mondrian/src/main/mondrian/rolap/RolapMember.java#1 $ */ class RolapMember extends MemberBase { int ordinal; Object key; Format format; static final RolapMember[] emptyArray = new RolapMember[0]; RolapMember( RolapMember parentMember, RolapLevel level, Object key, String name) { this.parentMember = parentMember; this.parentUniqueName = parentMember == null ? null: parentMember.getUniqueName(); this.level = level; this.name = name; this.caption = name; this.key = key; this.memberType = 1; // adMemberRegular this.uniqueName = (parentMember == null) ? Util.makeFqName(getHierarchy(), name) : Util.makeFqName(parentMember, name); } RolapMember( RolapMember parentMember, RolapLevel level, Object value) { this(parentMember, level, value, value.toString()); } public int compareHierarchically(Member o) { RolapMember other = (RolapMember) o; if (this.parentMember == other.parentMember) { // including case where both parents are null return 0; } else { return this.ordinal - other.ordinal; } } public Member getLeadMember(int n) { return ((RolapHierarchy) getHierarchy()).memberReader.getLeadMember( this, n); } public boolean isCalculatedInQuery() { return false; } public void setName(String name) { throw new Error("unsupported"); } // implement Exp public Object evaluateScalar(Evaluator evaluator) { Member old = evaluator.setContext(this); Object value = evaluator.evaluateCurrent(); evaluator.setContext(old); return value; } String quoteKeyForSql() { if ((((RolapLevel) level).flags & RolapLevel.NUMERIC) != 0) { return key.toString(); } else { return RolapUtil.singleQuoteForSql(key.toString()); } } int getSolveOrder() { return Integer.MAX_VALUE; } Format getFormat(Evaluator evaluator) { String formatString = getFormatString(evaluator); if (format == null || !format.getFormatString().equals(formatString)) { synchronized (this) { format = new Format( formatString, getCube().getConnection().getLocale()); } } return format; } /** * Converts a value of this member into a string according to this member's * format specification. **/ String format(Evaluator evaluator, Object o) { return getFormat(evaluator).format(o); } }; // End RolapMember.java
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 1576 | Julian Hyde |
mondrian: fix dataset (add column customer.ordinal); create dataset for oracle; get queries working on oracle; get format strings working; refactor out new packages mondrian.rolap.agg and mondrian.rolap.sql. |
||
#1 | 1453 | Julian Hyde | mondrian: first source check-in |