org.olap4j.mdx
Class IdentifierNode.NameSegment

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

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

Component in a compound identifier that describes the name of an object. Optionally, the name is quoted in brackets.

See Also:
IdentifierNode.KeySegment

Constructor Summary
IdentifierNode.NameSegment(ParseRegion region, java.lang.String name, IdentifierNode.Quoting quoting)
          Creates a segment with the given quoting and region.
IdentifierNode.NameSegment(java.lang.String name)
          Creates a quoted segment, "[name]".
 
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.NameSegment

public IdentifierNode.NameSegment(ParseRegion region,
                                  java.lang.String name,
                                  IdentifierNode.Quoting quoting)
Creates a segment with the given quoting and region.

Parameters:
region - Region of source code
name - Name
quoting - Quoting style

IdentifierNode.NameSegment

public IdentifierNode.NameSegment(java.lang.String name)
Creates a quoted segment, "[name]".

Parameters:
name - Name of segment
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

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

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

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