Class IndexColumnOrder

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) boolean ascending  
      (package private) int colNum
      This class implements Formatable.
      (package private) boolean nullsOrderedLow
      indicate whether NULL values should sort low.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getColumnId()  
      boolean getIsAscending()  
      boolean getIsNullsOrderedLow()
      Indicate whether NULL values should be ordered below non-NULL.
      int getTypeFormatId()
      Get the formatID which corresponds to this class.
      void readExternal​(java.io.ObjectInput in)
      Read this object from a stream of stored objects.
      java.lang.String toString()  
      void writeExternal​(java.io.ObjectOutput out)
      Write this object out
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • colNum

        int colNum
        This class implements Formatable. That means that it can write itself to and from a formatted stream. If you add more fields to this class, make sure that you also write/read them with the writeExternal()/readExternal() methods. If, inbetween releases, you add more fields to this class, then you should bump the version number emitted by the getTypeFormatId() method.
      • ascending

        boolean ascending
      • nullsOrderedLow

        boolean nullsOrderedLow
        indicate whether NULL values should sort low. nullsOrderedLow is usually false, because generally Derby defaults to have NULL values compare higher than non-null values, but if the user specifies an ORDER BY clause with a specification that indicates that NULL values should be ordered lower than non-NULL values, thien nullsOrderedLow is set to true.
    • Constructor Detail

      • IndexColumnOrder

        public IndexColumnOrder()
        Niladic constructor for formatable
      • IndexColumnOrder

        public IndexColumnOrder​(int colNum)
      • IndexColumnOrder

        public IndexColumnOrder​(int colNum,
                                boolean ascending)
      • IndexColumnOrder

        public IndexColumnOrder​(int colNum,
                                boolean ascending,
                                boolean nullsLow)
        constructor used by the ORDER BY clause. This version of the constructor is used by the compiler when it processes an ORDER BY clause in a SQL statement. For such statements, the user gets to control whether NULL values are ordered as lower than all non-NULL values, or higher than all non-NULL values.
        Parameters:
        colNum - number of this column
        ascending - whether the ORDER BY is ascendeing or descending
        nullsLow - whether nulls should be ordered low
    • Method Detail

      • getIsNullsOrderedLow

        public boolean getIsNullsOrderedLow()
        Indicate whether NULL values should be ordered below non-NULL. This function returns TRUE if the user has specified, via the clause in the ORDER BY clause, that NULL values of this column should sort lower than non-NULL values.
        Specified by:
        getIsNullsOrderedLow in interface ColumnOrdering
        Returns:
        whether nulls should sort low
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Write this object out
        Specified by:
        writeExternal in interface java.io.Externalizable
        Parameters:
        out - write bytes here
        Throws:
        java.io.IOException - thrown on error
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Read this object from a stream of stored objects.
        Specified by:
        readExternal in interface java.io.Externalizable
        Parameters:
        in - read this.
        Throws:
        java.io.IOException - thrown on error
        java.lang.ClassNotFoundException - thrown on error
      • getTypeFormatId

        public int getTypeFormatId()
        Get the formatID which corresponds to this class.
        Specified by:
        getTypeFormatId in interface TypedFormat
        Returns:
        the formatID of this class
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object