Package mondrian.olap
Class Formula
- java.lang.Object
-
- mondrian.olap.QueryPart
-
- mondrian.olap.Formula
-
-
Constructor Summary
Constructors Constructor Description Formula(boolean isMember, Id id, Exp exp, MemberProperty[] memberProperties, Member mdxMember, NamedSet mdxSet)Formula(Id id, Exp exp)Constructs formula specifying a set.Formula(Id id, Exp exp, MemberProperty[] memberProperties)Constructs a formula specifying a member.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectaccept(MdxVisitor visitor)Accepts a visitor to this Formula.(package private) voidaccept(Validator validator)Resolves identifiers into objects.Objectclone()(package private) static Formula[]cloneArray(Formula[] x)voidcompile()(package private) voidcreateElement(Query q)StringgetCaption()Returns this formula's caption.Object[]getChildren()Returns an array of the object's children.(package private) OlapElementgetElement()ExpgetExpression()IdgetIdentifier()Returns the Identifier of the set or member which is declared by this Formula.MembergetMdxMember()Returns the Member.StringgetName()Returns this formula's name.NamedSetgetNamedSet()NumbergetSolveOrder()Returns the solve order.(package private) StringgetUniqueName()Returns the unique name of the member or set.booleanisMember()(package private) voidrename(String newName)Changes the last part of the name tonewName.voidunparse(PrintWriter pw)Writes a string representation of this parse tree node to the given writer.
-
-
-
Constructor Detail
-
Formula
public Formula(Id id, Exp exp, MemberProperty[] memberProperties)
Constructs a formula specifying a member.
-
Formula
Formula(boolean isMember, Id id, Exp exp, MemberProperty[] memberProperties, Member mdxMember, NamedSet mdxSet)
-
-
Method Detail
-
accept
void accept(Validator validator)
Resolves identifiers into objects.- Parameters:
validator- Validation context to resolve the identifiers in this formula
-
createElement
void createElement(Query q)
-
getChildren
public Object[] getChildren()
Description copied from interface:WalkableReturns an array of the object's children. Those which are notWalkableare ignored.- Specified by:
getChildrenin interfaceWalkable- Overrides:
getChildrenin classQueryPart
-
unparse
public void unparse(PrintWriter pw)
Description copied from class:QueryPartWrites a string representation of this parse tree node to the given writer.
-
isMember
public boolean isMember()
-
getNamedSet
public NamedSet getNamedSet()
-
getIdentifier
public Id getIdentifier()
Returns the Identifier of the set or member which is declared by this Formula.- Returns:
- Identifier
-
getName
public String getName()
Returns this formula's name.
-
getCaption
public String getCaption()
Returns this formula's caption.
-
rename
void rename(String newName)
Changes the last part of the name tonewName. For example,[Abc].[Def].[Ghi]becomes[Abc].[Def].[Xyz]; and the member or set is renamed fromGhitoXyz.
-
getUniqueName
String getUniqueName()
Returns the unique name of the member or set.
-
getElement
OlapElement getElement()
-
getExpression
public Exp getExpression()
-
getMdxMember
public Member getMdxMember()
Returns the Member. (Not valid if this formula defines a set.)- Pre-condition:
- isMember()
- Post-condition:
- return != null
-
getSolveOrder
public Number getSolveOrder()
Returns the solve order. (Not valid if this formula defines a set.)- Returns:
- Solve order, or null if SOLVE_ORDER property is not specified or is not a number or is not constant
- Pre-condition:
- isMember()
-
compile
public void compile()
-
accept
public Object accept(MdxVisitor visitor)
Accepts a visitor to this Formula. The default implementation dispatches to theMdxVisitor.visit(Formula)method.- Parameters:
visitor- Visitor
-
-