Package org.olap4j.type
Class TypeUtil
java.lang.Object
org.olap4j.type.TypeUtil
Utility methods relating to types.
NOTE: This class is experimental. Not part of the public olap4j API.
- Since:
- Feb 17, 2005
- Author:
- jhyde
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canEvaluate
(Type type) Returns whether a value of a given type can be evaluated to a scalar value.static boolean
Returns whether a type is a set type.
-
Constructor Details
-
TypeUtil
public TypeUtil()
-
-
Method Details
-
canEvaluate
Returns whether a value of a given type can be evaluated to a scalar value.The rules are as follows:
- Clearly boolean, numeric and string expressions can be evaluated.
- Member and tuple expressions can be interpreted as a scalar value. The expression is evaluated to establish the context where a measure can be evaluated.
- Hierarchy and dimension expressions are implicitly converted into the current member, and evaluated as above.
- Level expressions cannot be evaluated
- Cube and Set (even sets with a single member) cannot be evaluated.
- Parameters:
type
- Type- Returns:
- Whether an expression of this type can be evaluated to yield a scalar value.
-
isSet
Returns whether a type is a set type.- Parameters:
type
- Type- Returns:
- Whether a value of this type can be evaluated to yield a set.
-