Package adql.parser
Class IdentifierItems
- java.lang.Object
-
- adql.parser.IdentifierItems
-
public class IdentifierItems extends java.lang.Object
Important: This class is designed to be filled ONLY byADQLParser
!This class is an array of maximum 4
IdentifierItems.IdentifierItem
.The goal is to represent complex ADQL identifiers (column, table, ...) which may be composed of more than only one identifier.
For instance, a table can be referenced either by only its name or by the name of its schema and its name. So, in this last case there are 2 identifiers.
It is possible to get one by one each identifier item (by using the getters), or the concatenation of all (thanks to
join(String)
).- Version:
- 1.4 (11/2017)
- Author:
- Grégory Mantelet (CDS;ARI)
- See Also:
IdentifierItems.IdentifierItem
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IdentifierItems.IdentifierItem
Represent any ADQL identifier (column name, table name or table/column alias).
-
Constructor Summary
Constructors Constructor Description IdentifierItems(boolean tableIdentifier)
Builds an IdentifierItems by specifying it is a table or a column identifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(IdentifierItems.IdentifierItem item)
Apppends a simple identifier, that's to say an additional field (catalog, schema, table, column).IdentifierItems.IdentifierItem
get(int ind)
Gets the whole ind-th identifier/field.int
getBeginColumn()
int
getBeginLine()
byte
getCaseSensitivity()
java.lang.String
getCatalog()
java.lang.String
getColumn()
boolean
getColumnCaseSensitivity()
int
getEndColumn()
int
getEndLine()
java.lang.String
getIdentifier(int ind)
Gets the value of the ind-th identifier/field.TextPosition
getPosition()
java.lang.String
getSchema()
java.lang.String
getTable()
java.lang.String
join(java.lang.String delim)
Joins all identifiers with the given delimiter.int
size()
Gets the number of fields/identifiers stored in thisIdentifierItems
.java.lang.String
toString()
-
-
-
Method Detail
-
append
public void append(IdentifierItems.IdentifierItem item)
Apppends a simple identifier, that's to say an additional field (catalog, schema, table, column).
Note: This function has no effect if there are already 4 identifiers.
- Parameters:
item
- Additional item (may be null).
-
size
public int size()
Gets the number of fields/identifiers stored in thisIdentifierItems
.- Returns:
- The number of identifiers.
-
get
public IdentifierItems.IdentifierItem get(int ind)
Gets the whole ind-th identifier/field.- Parameters:
ind
- Index of the identifier/field to get.- Returns:
- The wanted identifier/field.
-
getIdentifier
public java.lang.String getIdentifier(int ind)
Gets the value of the ind-th identifier/field.- Parameters:
ind
- Index of the identifier/field to get.- Returns:
- The value of the wanted identifier/field.
-
getCatalog
public java.lang.String getCatalog()
-
getSchema
public java.lang.String getSchema()
-
getTable
public java.lang.String getTable()
-
getColumn
public java.lang.String getColumn()
-
getBeginLine
public int getBeginLine()
-
getEndLine
public int getEndLine()
-
getBeginColumn
public int getBeginColumn()
-
getEndColumn
public int getEndColumn()
-
getPosition
public TextPosition getPosition()
-
getCaseSensitivity
public byte getCaseSensitivity()
-
getColumnCaseSensitivity
public boolean getColumnCaseSensitivity()
-
join
public java.lang.String join(java.lang.String delim)
Joins all identifiers with the given delimiter.- Parameters:
delim
- The string which must separate the identifiers (if null, the delimiter will be an empty string).- Returns:
- The joint complex identifier.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-