Class TypeUtil

java.lang.Object
org.olap4j.type.TypeUtil

public class TypeUtil extends Object
Utility methods relating to types.

NOTE: This class is experimental. Not part of the public olap4j API.

Since:
Feb 17, 2005
Author:
jhyde
  • Constructor Details

    • TypeUtil

      public TypeUtil()
  • Method Details

    • canEvaluate

      public static boolean canEvaluate(Type type)
      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

      public static boolean isSet(Type type)
      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.