Package adql.query
Enum IdentifierField
- java.lang.Object
-
- java.lang.Enum<IdentifierField>
-
- adql.query.IdentifierField
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<IdentifierField>
public enum IdentifierField extends java.lang.Enum<IdentifierField>
Lets getting or setting the case sensitivity of an identifier (column, table, schema, catalog or alias) of an
ADQLColumn
or anADQLTable
.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:
ADQLTable
,ADQLColumn
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static byte
getFullCaseSensitive(boolean sensitive)
Gets a byte in which all identifier parts are case sensitive or not.boolean
isCaseSensitive(byte caseSensitivity)
Tells whether this field is case sensitive in the given global case sensitivity definition.static boolean
isFullCaseSensitive(byte caseSensitivity)
Tells whether all identifier parts are case sensitive in the given global case sensitivity definition.byte
setCaseSensitive(byte caseSensitivity, boolean sensitive)
Sets the case sensitivity of this identifier part in the given global case sensitivity definition.static IdentifierField
valueOf(java.lang.String name)
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 Detail
-
COLUMN
public static final IdentifierField COLUMN
-
TABLE
public static final IdentifierField TABLE
-
SCHEMA
public static final IdentifierField SCHEMA
-
CATALOG
public static final IdentifierField CATALOG
-
ALIAS
public static final IdentifierField ALIAS
-
-
Method Detail
-
values
public static IdentifierField[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (IdentifierField c : IdentifierField.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static IdentifierField valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- 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.
-
-