Package org.olap4j.mdx
Interface IdentifierSegment
- All Known Implementing Classes:
KeySegment,NameSegment
public interface IdentifierSegment
Component in a compound identifier. It is described by its name and how
the name is quoted.
For example, the identifier
[Store].USA.[New Mexico].&[45] has four segments:
- "Store",
Quoting.QUOTED - "USA",
Quoting.UNQUOTED - "New Mexico",
Quoting.QUOTED - "45",
Quoting.KEY
QUOTED and UNQUOTED segments are represented using a
NameSegment;
KEY segments are represented using a
KeySegment.
To parse an identifier into a list of segments, use the method
IdentifierNode.parseIdentifier(String) and then call
IdentifierNode.getSegmentList() on the resulting
node.
- Author:
- jhyde
-
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.
-
Method Details
-
toString
String toString()Returns a string representation of this Segment.For example, "[Foo]", "&[123]", "Abc".
-
toString
Appends a string representation of this Segment to a StringBuffer.- Parameters:
buf- StringBuffer
-
getRegion
ParseRegion getRegion()Returns the region of the source code which this Segment was created from, if it was created by parsing.- Returns:
- region of source code
-
getQuoting
Quoting getQuoting()Returns how this Segment is quoted.- Returns:
- how this Segment is quoted
-
getName
String getName()Returns the name of this IdentifierSegment. Returnsnullif this IdentifierSegment represents a key.- Returns:
- name of this Segment
-
getKeyParts
List<NameSegment> getKeyParts()Returns the key components, if this IdentifierSegment is a key. (That is, ifgetQuoting()returnsQuoting.KEY.) Returns null otherwise.- Returns:
- Components of key, or null if this IdentifierSegment is not a key
-