org.olap4j.mdx
Class NameSegment

java.lang.Object
  extended by org.olap4j.mdx.NameSegment
All Implemented Interfaces:
IdentifierSegment

public class NameSegment
extends Object
implements IdentifierSegment

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

Version:
$Id: NameSegment.java 482 2012-01-05 23:27:27Z jhyde $
Author:
jhyde
See Also:
KeySegment

Constructor Summary
NameSegment(ParseRegion region, String name, Quoting quoting)
          Creates a segment with the given quoting and region.
NameSegment(String name)
          Creates a quoted segment, "[name]".
 
Method Summary
 List<NameSegment> getKeyParts()
          Returns the key components, if this IdentifierSegment is a key.
 String getName()
          Returns the name of this IdentifierSegment.
 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.
 String toString()
          Returns a string representation of this Segment.
 void toString(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

NameSegment

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

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

NameSegment

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

Parameters:
name - Name of segment
Method Detail

toString

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

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

Specified by:
toString in interface IdentifierSegment
Overrides:
toString in class Object
Returns:
String representation of this Segment

toString

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

Specified by:
toString in interface IdentifierSegment
Parameters:
buf - StringBuffer

getRegion

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

Specified by:
getRegion in interface IdentifierSegment
Returns:
region of source code

getName

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

Specified by:
getName in interface IdentifierSegment
Returns:
name of this Segment

getQuoting

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

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

getKeyParts

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

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

SourceForge.net_Logo