Multi-part identifier.
An identifier is immutable.
An identifer consists of one or more {@link IdentifierSegment}s. A segment is either:
- An unquoted value such as ' {@code CA}',
- A value quoted in brackets, such as ' {@code [San Francisco]}', or
- A key of one or more parts, each of which is prefixed with '&', such as ' {@code &[Key 1]&Key2&[5]}'.
Segment types are indicated by the {@link Quoting} enumeration.
A key segment is of type {@link Quoting#KEY}, and has one or more component parts accessed via the {@link IdentifierSegment#getKeyParts()} method. The partsare of type {@link Quoting#UNQUOTED} or {@link Quoting#QUOTED}.
A simple example is the identifier {@code Measures.[Unit Sales]}. It has two segments:
- Segment #0 is {@link Quoting#UNQUOTED UNQUOTED}, name "Measures"
- Segment #1 is {@link Quoting#QUOTED QUOTED}, name "Unit Sales"
A more complex example illustrates a compound key. The identifier {@code [Customers].[City].&[San Francisco]&CA&USA.&[cust1234]}contains four segments as follows:
- Segment #0 is QUOTED, name "Customers"
- Segment #1 is QUOTED, name "City"
- Segment #2 is a {@link Quoting#KEY KEY}. It has 3 sub-segments:
- Sub-segment #0 is QUOTED, name "San Francisco"
- Sub-segment #1 is UNQUOTED, name "CA"
- Sub-segment #2 is UNQUOTED, name "USA"
- Segment #3 is a KEY. It has 1 sub-segment:
- Sub-segment #0 is QUOTED, name "cust1234"
@version $Id: IdentifierNode.java 360 2010-10-28 18:14:32Z jhyde $
@author jhyde