Package org.olap4j.mdx
Class KeySegment
java.lang.Object
org.olap4j.mdx.KeySegment
- All Implemented Interfaces:
IdentifierSegment
Segment that represents a key or compound key.
Such a segment appears in an identifier with each component prefixed
with "&". For example, in the identifier
"[Customer].[State].&[WA]&[USA]", the third segment is
a compound key whose parts are "WA" and "USA".
- Author:
- jhyde
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionKeySegment(List<NameSegment> subSegmentList) Creates a KeySegment a list of sub-segments.KeySegment(NameSegment... subSegments) Creates a KeySegment with one or more sub-segments. -
Method Summary
Modifier and TypeMethodDescriptionReturns the key components, if this IdentifierSegment is a key.getName()Returns the name of this IdentifierSegment.Returns how this Segment is quoted.Returns the region of the source code which this Segment was created from, if it was created by parsing.toString()Returns a string representation of this Segment.voidtoString(StringBuilder buf) Appends a string representation of this Segment to a StringBuffer.
-
Constructor Details
-
KeySegment
Creates a KeySegment with one or more sub-segments.- Parameters:
subSegments- Array of sub-segments
-
KeySegment
Creates a KeySegment a list of sub-segments.- Parameters:
subSegmentList- List of sub-segments
-
-
Method Details
-
toString
Description copied from interface:IdentifierSegmentReturns a string representation of this Segment.For example, "[Foo]", "&[123]", "Abc".
- Specified by:
toStringin interfaceIdentifierSegment- Overrides:
toStringin classObject- Returns:
- String representation of this Segment
-
toString
Description copied from interface:IdentifierSegmentAppends a string representation of this Segment to a StringBuffer.- Specified by:
toStringin interfaceIdentifierSegment- Parameters:
buf- StringBuffer
-
getRegion
Description copied from interface:IdentifierSegmentReturns the region of the source code which this Segment was created from, if it was created by parsing.- Specified by:
getRegionin interfaceIdentifierSegment- Returns:
- region of source code
-
getQuoting
Description copied from interface:IdentifierSegmentReturns how this Segment is quoted.- Specified by:
getQuotingin interfaceIdentifierSegment- Returns:
- how this Segment is quoted
-
getName
Description copied from interface:IdentifierSegmentReturns the name of this IdentifierSegment. Returnsnullif this IdentifierSegment represents a key.- Specified by:
getNamein interfaceIdentifierSegment- Returns:
- name of this Segment
-
getKeyParts
Description copied from interface:IdentifierSegmentReturns the key components, if this IdentifierSegment is a key. (That is, ifIdentifierSegment.getQuoting()returnsQuoting.KEY.) Returns null otherwise.- Specified by:
getKeyPartsin interfaceIdentifierSegment- Returns:
- Components of key, or null if this IdentifierSegment is not a key
-