Package adql.query

Enum 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 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:
    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.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • 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 name
        java.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.