org.olap4j.mdx
Interface IdentifierNode.Segment

All Known Implementing Classes:
IdentifierNode.KeySegment, IdentifierNode.NameSegment
Enclosing class:
IdentifierNode

public static interface IdentifierNode.Segment

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:

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


Method Summary
 java.util.List<IdentifierNode.NameSegment> getKeyParts()
          Returns the key components, if this Segment is a key.
 java.lang.String getName()
          Returns the name of this Segment.
 IdentifierNode.Quoting getQuoting()
          Returns how this Segment is quoted.
 ParseRegion getRegion()
          Returns the region of the source code which this Segment was created from, if it was created by parsing.
 java.lang.String toString()
          Returns a string representation of this Segment.
 void toString(java.lang.StringBuilder buf)
          Appends a string representation of this Segment to a StringBuffer.
 

Method Detail

toString

java.lang.String toString()
Returns a string representation of this Segment.

For example, "[Foo]", "&[123]", "Abc".

Overrides:
toString in class java.lang.Object
Returns:
String representation of this Segment

toString

void toString(java.lang.StringBuilder buf)
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

IdentifierNode.Quoting getQuoting()
Returns how this Segment is quoted.

Returns:
how this Segment is quoted

getName

java.lang.String getName()
Returns the name of this Segment. Returns null if this Segment represents a key.

Returns:
name of this Segment

getKeyParts

java.util.List<IdentifierNode.NameSegment> getKeyParts()
Returns the key components, if this Segment is a key. (That is, if getQuoting() returns IdentifierNode.Quoting.KEY.) Returns null otherwise.

Returns:
Components of key, or null if this Segment is not a key

SourceForge.net_Logo