Package adql.query
Enum IdentifierField
- All Implemented Interfaces:
Serializable
,Comparable<IdentifierField>
,java.lang.constant.Constable
Lets getting or setting the case sensitivity of an identifier (column, table, schema, catalog or alias)
of an ADQLColumn
or an ADQLTable
.
The case sensitivity of an ADQL identifier is defined in a single attribute of type 'byte'. Each bit is designed to indicate the case sensitivity of a particular identifier part (from right to left):
- 1st bit = column
- 2nd bit = table
- 3rd bit = schema
- 4th bit = catalog
- 5th bit = alias
Consequently to manage the case sensitivity of an identifier, you can use the following methods:
isCaseSensitive(byte)
: to know whether an identifier part is case sensitive or not in the given bytesetCaseSensitive(byte, boolean)
: to modify the given byte so that setting the case sensitivity of an identifier part
Example: In ADQLColumn
, the attribute 'caseSensitivity' lets managing the case sensitivity of all parts of the column identifier.
public class ADQLColumn implements ADQLOperand { ... private byte caseSensitivity = 0; ... public final boolean isCaseSensitive(IdentifierField field){ return field.isCaseSensitive(caseSensitivity); } public final void setCaseSensitive(IdentifierField field, boolean sensitive){ caseSensitivity = field.setCaseSensitive(caseSensitivity, sensitive); } ... } ADQLColumn column = new ADQLColumn("myCat.mySchema.myTable.colName"); column.setCaseSensitive(IdentifierField.TABLE, true); System.out.println("Is column name case sensitive ? "+column.isCaseSensitive(IdentifierField.COLUMN));
- Version:
- 08/2011
- Author:
- Grégory Mantelet (CDS)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic final byte
getFullCaseSensitive
(boolean sensitive) Gets a byte in which all identifier parts are case sensitive or not.final boolean
isCaseSensitive
(byte caseSensitivity) Tells whether this field is case sensitive in the given global case sensitivity definition.static final boolean
isFullCaseSensitive
(byte caseSensitivity) Tells whether all identifier parts are case sensitive in the given global case sensitivity definition.final byte
setCaseSensitive
(byte caseSensitivity, boolean sensitive) Sets the case sensitivity of this identifier part in the given global case sensitivity definition.static IdentifierField
Returns the enum constant of this type with the specified name.static IdentifierField[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
COLUMN
-
TABLE
-
SCHEMA
-
CATALOG
-
ALIAS
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isCaseSensitive
public final boolean isCaseSensitive(byte caseSensitivity) Tells whether this field is case sensitive in the given global case sensitivity definition.- Parameters:
caseSensitivity
- Definition of the case sensitivity of a whole ADQL identifier.- Returns:
- true if this field is case sensitive, false otherwise.
-
setCaseSensitive
public final byte setCaseSensitive(byte caseSensitivity, boolean sensitive) Sets the case sensitivity of this identifier part in the given global case sensitivity definition.- Parameters:
caseSensitivity
- Definition of the case sensitivity of a whole ADQL identifier.sensitive
- true for case sensitive, false otherwise.- Returns:
- The modified case sensitivity definition.
-
isFullCaseSensitive
public static final boolean isFullCaseSensitive(byte caseSensitivity) Tells whether all identifier parts are case sensitive in the given global case sensitivity definition.- Parameters:
caseSensitivity
- Definition of the case sensitivity of a whole ADQL identifier.- Returns:
- true if all identifier parts are case sensitive, false otherwise.
-
getFullCaseSensitive
public static final byte getFullCaseSensitive(boolean sensitive) Gets a byte in which all identifier parts are case sensitive or not.- Parameters:
sensitive
- true to set all identifier parts case sensitive, false otherwise.- Returns:
- A byte with all identifier parts case sensitive if sensitive is true, false otherwise.
-