|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondrian.olap.type.TypeUtil
public class TypeUtil
Utility methods relating to types.
Constructor Summary | |
---|---|
TypeUtil()
|
Method Summary | ||
---|---|---|
static boolean |
canConvert(int from,
int to,
int[] conversionCount)
Returns whether we can convert an argument of a given category to a given parameter category. |
|
static boolean |
canEvaluate(Type type)
Returns whether a value of a given type can be evaluated to a scalar value. |
|
static Type |
computeCommonType(boolean allowConversions,
Type... types)
Returns a type sufficiently broad to hold any value of several types, but as narrow as possible. |
|
static boolean |
couldBeMember(Type type)
|
|
static boolean |
isSet(Type type)
Returns whether a type is a set type. |
|
static boolean |
isUnionCompatible(Type type1,
Type type2)
Returns whether this type is union-compatible with another. |
|
(package private) static
|
neq(T t1,
T t2)
|
|
static Type |
stripSetType(Type type)
Given a set type, returns the element type. |
|
static Type |
toMemberOrTupleType(Type type)
Converts a type to a member or tuple type. |
|
static MemberType |
toMemberType(Type type)
Converts a type to a member type. |
|
static int |
typeToCategory(Type type)
Converts a Type value to a Category ordinal. |
|
static Hierarchy |
typeToHierarchy(Type type)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TypeUtil()
Method Detail |
---|
public static Hierarchy typeToHierarchy(Type type)
public static Type stripSetType(Type type)
type
- Type
public static Type toMemberOrTupleType(Type type)
type
- Type
public static MemberType toMemberType(Type type)
type
- Type
public static boolean isUnionCompatible(Type type1, Type type2)
type1
- First typetype2
- Second type
public static boolean canEvaluate(Type type)
The rules are as follows:
type
- Type
public static boolean isSet(Type type)
type
- Type
public static boolean couldBeMember(Type type)
public static int typeToCategory(Type type)
Type
value to a Category
ordinal.
type
- Type
public static Type computeCommonType(boolean allowConversions, Type... types)
The result is equivalent to calling
Type.computeCommonType(Type, int[])
pairwise.
allowConversions
- Whether to allow implicit conversionstypes
- Array of types
public static boolean canConvert(int from, int to, int[] conversionCount)
from
- actual argument categoryto
- formal parameter categoryconversionCount
- in/out count of number of conversions performed;
is incremented if the conversion is non-trivial (for
example, converting a member to a level).
static <T> T neq(T t1, T t2)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |