Package adql.query

Enum IdentifierField

java.lang.Object
java.lang.Enum<IdentifierField>
adql.query.IdentifierField
All Implemented Interfaces:
Serializable, Comparable<IdentifierField>, java.lang.constant.Constable

public enum IdentifierField extends Enum<IdentifierField>

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:

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:
  • Enum Constant Details

  • Method Details

    • values

      public static IdentifierField[] 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

      public static IdentifierField valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      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.