Modifier and Type | Field and Description |
---|---|
static MemberType |
Unknown |
Constructor and Description |
---|
MemberType(Dimension dimension,
Hierarchy hierarchy,
Level level,
Member member)
Creates a type representing a member.
|
Modifier and Type | Method and Description |
---|---|
Type |
computeCommonType(Type type,
int[] conversionCount)
Returns a Type which is more general than this and the given Type.
|
static MemberType |
forDimension(Dimension dimension) |
static MemberType |
forHierarchy(Hierarchy hierarchy) |
static MemberType |
forLevel(Level level) |
static MemberType |
forMember(Member member) |
static MemberType |
forType(Type type) |
int |
getArity()
Returns the number of fields in a tuple type, or a set of tuples.
|
Dimension |
getDimension()
Returns the Dimension of this Type, or null if not known.
|
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.
|
Member |
getMember() |
Type |
getValueType() |
boolean |
isInstance(Object value)
Returns whether a value is valid for a type.
|
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. |
boolean |
usesHierarchy(Hierarchy hierarchy,
boolean definitely)
Returns whether this type contains a given hierarchy.
For example:
HierarchyType([Customer].[Gender]) uses only the
[Customer].[Gender] hierarchy.
TupleType(MemberType([Customer].[Gender]),
MemberType([Store].[Store]))
uses [Gender] and [Store]
dimensions.
The definitely parameter comes into play when the
dimensional information is incomplete. |
public static final MemberType Unknown
public MemberType(Dimension dimension, Hierarchy hierarchy, Level level, Member member)
dimension
- Dimension the member belongs to, or null if not knownhierarchy
- Hierarchy the member belongs to, or null if not knownlevel
- Level the member belongs to, or null if not knownmember
- The precise member, or null if not knownpublic static MemberType forDimension(Dimension dimension)
public static MemberType forHierarchy(Hierarchy hierarchy)
public static MemberType forLevel(Level level)
public static MemberType forMember(Member member)
public Hierarchy getHierarchy()
Type
getHierarchy
in interface Type
public Level getLevel()
Type
public Member getMember()
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 dimensionpublic boolean usesHierarchy(Hierarchy hierarchy, boolean definitely)
Type
HierarchyType([Customer].[Gender])
uses only the
[Customer].[Gender]
hierarchy.TupleType(MemberType([Customer].[Gender]),
MemberType([Store].[Store]))
uses [Gender]
and [Store]
dimensions.definitely
parameter comes into play when the
dimensional information is incomplete. For example, when applied to
TupleType(MemberType([Customer]), MemberType([Store]))
,
usesDimension([Customer].[Gender], false)
returns true
because the expression returns a member of one hierarchy of the
[Customer]
dimension and that might be a member of the
[Customer].[Gender]
hierarchy; but
usesDimension([Customer].[Gender], true)
returns false
because might return a member of a different hierarchy, such as
[Customer].[State]
.usesHierarchy
in interface Type
hierarchy
- Hierarchydefinitely
- If true, returns true only if this type definitely
uses the hierarchypublic Type getValueType()
public Dimension getDimension()
Type
getDimension
in interface Type
public static MemberType forType(Type type)
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 consideredpublic boolean isInstance(Object value)
Type
isInstance
in interface Type
value
- ValueCopyright © 2018 Hitachi Vantara. All rights reserved.