Interface Cube
- All Superinterfaces:
MetadataElement
A Cube belongs to a Schema
, and is described by a list of
Dimension
s and a list of Measure
s. It may also have one or
more NamedSet
s.
- Since:
- Aug 22, 2006
- Author:
- jhyde
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns a list ofDimension
objects in this Cube.Returns a list ofHierarchy
objects in this Cube.Returns a list ofMeasure
objects in this Cube.Returns theSchema
this Cube belongs to.getSets()
Returns a list ofNamedSet
objects in this Cube.Returns a collection ofLocale
objects for which thisCube
has been localized.boolean
Tells whether or not drill through operations are possible in this cube.lookupMember
(List<IdentifierSegment> nameParts) Finds a member in the current Cube based upon its fully-qualified name.lookupMembers
(Set<Member.TreeOp> treeOps, List<IdentifierSegment> nameParts) Finds a collection of members in the current Cube related to a given member.Methods inherited from interface org.olap4j.metadata.MetadataElement
getCaption, getDescription, getName, getUniqueName, isVisible
-
Method Details
-
getSchema
Schema getSchema()Returns theSchema
this Cube belongs to.- Returns:
- Schema this Cube belongs to
-
getDimensions
Returns a list ofDimension
objects in this Cube.The caller should assume that the list is immutable; if the caller modifies the list, behavior is undefined.
- Returns:
- list of Dimensions
- See Also:
-
getHierarchies
Returns a list ofHierarchy
objects in this Cube.The caller should assume that the list is immutable; if the caller modifies the list, behavior is undefined.
- Returns:
- list of Dimensions
- See Also:
-
getMeasures
Returns a list ofMeasure
objects in this Cube.The list includes both stored and calculated members, and (unlike the
OlapDatabaseMetaData.getMeasures(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
method or the MDSCHEMA_MEASURES XMLA request) is sorted by ordinal.- Returns:
- list of Measures
- See Also:
-
getSets
Returns a list ofNamedSet
objects in this Cube.The caller should assume that the list is immutable; if the caller modifies the list, behavior is undefined.
- Returns:
- list of NamedSets
- See Also:
-
getSupportedLocales
Collection<Locale> getSupportedLocales()Returns a collection ofLocale
objects for which thisCube
has been localized.Consider the following use case. Suppose one cube is available in English and French, and in French and Spanish, and both are shown in same portal. Clients typically say that seeing reports in a mixture of languages is confusing; the portal would figure out the best common language, in this case French. This method allows the client to choose the most appropriate locale.
The list is advisory: a client is free to choose another locale, in which case, the server will probably revert to the base locale for locale-specific behavior such as captions and formatting.
- Returns:
- List of locales for which this
Cube
has been localized - See Also:
-
lookupMember
Finds a member in the current Cube based upon its fully-qualified name. Returns the member, or null if there is no member with this name.The fully-qualified name starts with the name of the dimension, followed by the name of a root member, and continues with the name of each successive member on the path from the root member. If a member's name is unique within its level, preceding member name can be omitted.
For example,
"[Product].[Food]"
and"[Product].[All Products].[Food]"
are both valid ways to locate the "Food" member of the "Product" dimension.The name is represented as a list of
IdentifierSegment
objects. There are some common ways to create such a list. If you have an identifier, callIdentifierNode.parseIdentifier(String)
to parse the string into an identifier, thenIdentifierNode.getSegmentList()
. For example,Member member = cube.lookupMember(
IdentifierNode.parseIdentifier( "[Product].[Food]").getSegmentList())If you have an array of names, call
IdentifierNode.ofNames(String...)
. For example,Member member = cube.lookupMember(
IdentifierNode.parseIdentifier( "[Product].[Food]").getSegmentList())- Parameters:
nameParts
- Components of the fully-qualified member name- Returns:
- member with the given name, or null if not found
- Throws:
OlapException
- if error occurs
-
lookupMembers
List<Member> lookupMembers(Set<Member.TreeOp> treeOps, List<IdentifierSegment> nameParts) throws OlapException Finds a collection of members in the current Cube related to a given member.The method first looks up a member with the given fully-qualified name as for
lookupMember(java.util.List)
, then applies the set of tree-operations to find related members.The returned collection is sorted by level number then by member ordinal. If no member is found with the given name, the collection is empty.
For example,
returnslookupMembers( EnumSet.of(TreeOp.ANCESTORS, TreeOp.CHILDREN), "Time", "1997", "Q2")
[Time].[1997] [Time].[1997].[Q2].[4] [Time].[1997].[Q2].[5] [Time].[1997].[Q2].[6]
The fully-qualified name starts with the name of the dimension, followed by the name of a root member, and continues with the name of each successive member on the path from the root member. If a member's name is unique within its level, preceding member name can be omitted.
For example,
lookupMember("Product", "Food")
andlookupMember("Product", "All Products", "Food")
are both valid ways to locate the "Food" member of the "Product" dimension.- Parameters:
treeOps
- Collection of tree operations to travel relative to given member in order to create list of membersnameParts
- Components of the fully-qualified member name- Returns:
- collection of members related to the given member, or empty set if the member is not found
- Throws:
OlapException
- if error occurs
-
isDrillThroughEnabled
boolean isDrillThroughEnabled()Tells whether or not drill through operations are possible in this cube.- Returns:
- True if drillthrough is enabled, false otherwise.
-