Class TypeUtil


  • public class TypeUtil
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      TypeUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean canEvaluate​(Type type)
      Returns whether a value of a given type can be evaluated to a scalar value.
      static boolean isSet​(Type type)
      Returns whether a type is a set type.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TypeUtil

        public TypeUtil()
    • Method Detail

      • 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.