|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondrian.olap.type.SetType
public class SetType
Set type.
Constructor Summary | |
---|---|
SetType(Type elementType)
Creates a type representing a set of elements of a given type. |
Method Summary | |
---|---|
Type |
computeCommonType(Type type,
int[] conversionCount)
Returns a Type which is more general than this and the given Type. |
boolean |
equals(Object obj)
|
int |
getArity()
Returns the dimensionality of this SetType. |
Dimension |
getDimension()
Returns the Dimension of this Type, or null if not known. |
Type |
getElementType()
Returns the type of the elements of this set. |
Hierarchy |
getHierarchy()
Returns the Hierarchy of this Type, or null if not known. |
Level |
getLevel()
Returns the Level of this Type, or null if not known. |
int |
hashCode()
|
String |
toString()
|
boolean |
usesDimension(Dimension dimension,
boolean definitely)
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.
The definitely parameter comes into play when the
dimensional information is incomplete. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SetType(Type elementType)
elementType
- The type of the elements in the set, or null if not
knownMethod Detail |
---|
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
public Type getElementType()
public boolean usesDimension(Dimension dimension, boolean definitely)
Type
DimensionType([Gender])
uses only the
[Gender]
dimension.TupleType(MemberType([Gender]), MemberType([Store]))
uses [Gender]
and [Store]
dimensions.definitely
parameter comes into play when the
dimensional information is incomplete. For example, when applied to
TupleType(MemberType(null), MemberType([Store]))
,
usesDimension([Gender], false)
returns true because it
is possible that the expression returns a member of the
[Gender]
dimension; but
usesDimension([Gender], true)
returns true because it
is possible that the expression returns a member of the
[Gender]
dimension.
usesDimension
in interface Type
dimension
- Dimensiondefinitely
- If true, returns true only if this type definitely
uses the dimension
public Dimension getDimension()
Type
getDimension
in interface Type
public Hierarchy getHierarchy()
Type
getHierarchy
in interface Type
public Level getLevel()
Type
getLevel
in interface Type
public int getArity()
public Type computeCommonType(Type type, int[] conversionCount)
Type
Some examples:
If conversionCount
is not null, implicit conversions
such as HierarchyType to DimensionType are considered; the parameter
is incremented by the number of conversions performed.
Some examples:
One use of common types is to determine the types of the arguments
to the Iif
function. For example, the call
Iif(1 > 2, [Measures].[Unit Sales], 5)
has type ScalarType, because DecimalType(-1, 0) is a subtype of
ScalarType, and MeasureType can be converted implicitly to ScalarType.
computeCommonType
in interface Type
type
- TypeconversionCount
- Number of conversions; output parameter that is
incremented each time a conversion is performed; if null, conversions
are not considered
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |