org.olap4j.mdx
Class IdentifierNode.KeySegment

java.lang.Object
  extended by org.olap4j.mdx.IdentifierNode.KeySegment
All Implemented Interfaces:
IdentifierNode.Segment
Enclosing class:
IdentifierNode

public static class IdentifierNode.KeySegment
extends java.lang.Object
implements IdentifierNode.Segment

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 "@{code WA}" and "USA".

See Also:
IdentifierNode.NameSegment

Constructor Summary
IdentifierNode.KeySegment(IdentifierNode.NameSegment... subSegments)
          Creates a KeySegment with one or more sub-segments.
IdentifierNode.KeySegment(java.util.List<IdentifierNode.NameSegment> subSegmentList)
          Creates a KeySegment a list of sub-segments.
 
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdentifierNode.KeySegment

public IdentifierNode.KeySegment(IdentifierNode.NameSegment... subSegments)
Creates a KeySegment with one or more sub-segments.

Parameters:
subSegments - Array of sub-segments

IdentifierNode.KeySegment

public IdentifierNode.KeySegment(java.util.List<IdentifierNode.NameSegment> subSegmentList)
Creates a KeySegment a list of sub-segments.

Parameters:
subSegmentList - List of sub-segments
Method Detail

toString

public java.lang.String toString()
Description copied from interface: IdentifierNode.Segment
Returns a string representation of this Segment.

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

Specified by:
toString in interface IdentifierNode.Segment
Overrides:
toString in class java.lang.Object
Returns:
String representation of this Segment

toString

public void toString(java.lang.StringBuilder buf)
Description copied from interface: IdentifierNode.Segment
Appends a string representation of this Segment to a StringBuffer.

Specified by:
toString in interface IdentifierNode.Segment
Parameters:
buf - StringBuffer

getRegion

public ParseRegion getRegion()
Description copied from interface: IdentifierNode.Segment
Returns the region of the source code which this Segment was created from, if it was created by parsing.

Specified by:
getRegion in interface IdentifierNode.Segment
Returns:
region of source code

getQuoting

public IdentifierNode.Quoting getQuoting()
Description copied from interface: IdentifierNode.Segment
Returns how this Segment is quoted.

Specified by:
getQuoting in interface IdentifierNode.Segment
Returns:
how this Segment is quoted

getName

public java.lang.String getName()
Description copied from interface: IdentifierNode.Segment
Returns the name of this Segment. Returns null if this Segment represents a key.

Specified by:
getName in interface IdentifierNode.Segment
Returns:
name of this Segment

getKeyParts

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

Specified by:
getKeyParts in interface IdentifierNode.Segment
Returns:
Components of key, or null if this Segment is not a key

SourceForge.net_Logo