org.olap4j.type
Class MemberType

java.lang.Object
  extended by org.olap4j.type.MemberType
All Implemented Interfaces:
Type

public class MemberType
extends Object
implements Type

The type of an expression which represents a member.

Since:
Feb 17, 2005
Version:
$Id: MemberType.java 482 2012-01-05 23:27:27Z jhyde $
Author:
jhyde

Constructor Summary
MemberType(Dimension dimension, Hierarchy hierarchy, Level level, Member member)
          Creates a type representing a member.
 
Method Summary
 Dimension getDimension()
          Returns the dimension of this type, or null if not known.
 Hierarchy getHierarchy()
          Returns the hierarchy of this type.
 Level getLevel()
          Returns the level of this type, or null if not known.
 Member getMember()
          Returns the member of this type, or null if not known.
 String toString()
           
 boolean usesDimension(Dimension dimension, boolean maybe)
          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 maybe parameter comes into play when the dimensional information is incomplete.

 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MemberType

public MemberType(Dimension dimension,
                  Hierarchy hierarchy,
                  Level level,
                  Member member)
Creates a type representing a member.

Parameters:
dimension - Dimension the member belongs to, or null if not known.
hierarchy - Hierarchy the member belongs to, or null if not known.
level - Level the member belongs to, or null if not known
member - The precise member, or null if not known
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getHierarchy

public Hierarchy getHierarchy()
Description copied from interface: Type
Returns the hierarchy of this type. If not applicable, throws.

Specified by:
getHierarchy in interface Type
Returns:
hierarchy of this type

getLevel

public Level getLevel()
Description copied from interface: Type
Returns the level of this type, or null if not known.

Specified by:
getLevel in interface Type
Returns:
level of this type

getMember

public Member getMember()
Returns the member of this type, or null if not known.

Returns:
member of this type

usesDimension

public boolean usesDimension(Dimension dimension,
                             boolean maybe)
Description copied from interface: Type
Returns whether this type contains a given dimension.

For example:

The maybe 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.

Specified by:
usesDimension in interface Type
Parameters:
dimension - Dimension
maybe - If true, returns true only if this type definitely uses the dimension
Returns:
whether this type definitely (or if maybe is true, possibly) uses the given dimension

getDimension

public Dimension getDimension()
Description copied from interface: Type
Returns the dimension of this type, or null if not known.

Specified by:
getDimension in interface Type
Returns:
dimension of this type

SourceForge.net_Logo