Package org.olap4j.mdx
Class NameSegment
java.lang.Object
org.olap4j.mdx.NameSegment
- All Implemented Interfaces:
IdentifierSegment
Component in a compound identifier that describes the name of an object.
Optionally, the name is quoted in brackets.
- Author:
- jhyde
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNameSegment
(String name) Creates a quoted segment, "[name]".NameSegment
(ParseRegion region, String name, Quoting quoting) Creates a segment with the given quoting and region. -
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.void
toString
(StringBuilder buf) Appends a string representation of this Segment to a StringBuffer.
-
Constructor Details
-
NameSegment
Creates a segment with the given quoting and region.- Parameters:
region
- Region of source codename
- Namequoting
- Quoting style
-
NameSegment
Creates a quoted segment, "[name]".- Parameters:
name
- Name of segment
-
-
Method Details
-
toString
Description copied from interface:IdentifierSegment
Returns a string representation of this Segment.For example, "[Foo]", "&[123]", "Abc".
- Specified by:
toString
in interfaceIdentifierSegment
- Overrides:
toString
in classObject
- Returns:
- String representation of this Segment
-
toString
Description copied from interface:IdentifierSegment
Appends a string representation of this Segment to a StringBuffer.- Specified by:
toString
in interfaceIdentifierSegment
- Parameters:
buf
- StringBuffer
-
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 interfaceIdentifierSegment
- Returns:
- region of source code
-
getName
Description copied from interface:IdentifierSegment
Returns the name of this IdentifierSegment. Returnsnull
if this IdentifierSegment represents a key.- Specified by:
getName
in interfaceIdentifierSegment
- Returns:
- name of this Segment
-
getQuoting
Description copied from interface:IdentifierSegment
Returns how this Segment is quoted.- Specified by:
getQuoting
in interfaceIdentifierSegment
- Returns:
- how this Segment is quoted
-
getKeyParts
Description copied from interface:IdentifierSegment
Returns the key components, if this IdentifierSegment is a key. (That is, ifIdentifierSegment.getQuoting()
returnsQuoting.KEY
.) Returns null otherwise.- Specified by:
getKeyParts
in interfaceIdentifierSegment
- Returns:
- Components of key, or null if this IdentifierSegment is not a key
-