Package org.olap4j.type
Class HierarchyType
- java.lang.Object
-
- org.olap4j.type.HierarchyType
-
-
Constructor Summary
Constructors Constructor Description HierarchyType(Dimension dimension, Hierarchy hierarchy)
Creates a type representing a hierarchy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Dimension
getDimension()
Returns the dimension of this type, or null if not known.Hierarchy
getHierarchy()
Returns the hierarchy of this type.Level
getLevel()
Returns the level of this type, or null if not known.java.lang.String
toString()
boolean
usesDimension(Dimension dimension, boolean maybe)
Returns whether this type contains a given dimension.
-
-
-
Constructor Detail
-
HierarchyType
public HierarchyType(Dimension dimension, Hierarchy hierarchy)
Creates a type representing a hierarchy.- Parameters:
dimension
- Dimension which values of this type must belong to, or null if not knownhierarchy
- Hierarchy which values of this type must belong to, or null if not known
-
-
Method Detail
-
usesDimension
public boolean usesDimension(Dimension dimension, boolean maybe)
Description copied from interface:Type
Returns whether this type contains a given dimension. For example:DimensionType([Gender])
uses only the[Gender]
dimension.TupleType(MemberType([Gender]), MemberType([Store]))
uses[Gender]
and[Store]
dimensions.
maybe
parameter comes into play when the dimensional information is incomplete. For example, when applied toTupleType(MemberType(null), MemberType([Store]))
,usesDimension([Gender], false)
returns true because it is possible that the expression returns a member of the[Gender]
dimension.- Specified by:
usesDimension
in interfaceType
- Parameters:
dimension
- Dimensionmaybe
- If true, returns true only if this type definitely uses the dimension- Returns:
- whether this type definitely (or if
maybe
is true, possibly) uses the given dimension
-
getDimension
public Dimension getDimension()
Description copied from interface:Type
Returns the dimension of this type, or null if not known.- Specified by:
getDimension
in interfaceType
- Returns:
- dimension of this type
-
getHierarchy
public Hierarchy getHierarchy()
Description copied from interface:Type
Returns the hierarchy of this type. If not applicable, throws.- Specified by:
getHierarchy
in interfaceType
- Returns:
- hierarchy of this type
-
getLevel
public Level getLevel()
Description copied from interface:Type
Returns the level of this type, or null if not known.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-