Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

public Class IndexColumnOrder

extends Object
implements ColumnOrdering, Formatable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable, org.apache.derby.iapi.store.access.ColumnOrdering
Imports
org.apache.derby.iapi.store.access.ColumnOrdering, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.io.StoredFormatIds, .FormatIdUtil, .Formatable, java.io.ObjectOutput, .ObjectInput, .IOException

Basic implementation of ColumnOrdering. Not sure what to tell callers about 0-based versus 1-based numbering. Assume 0-based for now.

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv int
colNum

This class implements Formatable.

pack-priv boolean
nullsOrderedLow

indicate whether NULL values should sort low.

Constructor Summary

AccessConstructor and Description
public
IndexColumnOrder()

Niladic constructor for formatable

public
IndexColumnOrder(int colNum)

public
IndexColumnOrder(int colNum, boolean ascending)

public
IndexColumnOrder(int
number of this column
colNum
,
boolean
whether the ORDER BY is ascendeing or descending
ascending
,
boolean
whether nulls should be ordered low
nullsLow
)

constructor used by the ORDER BY clause.

Method Summary

Modifier and TypeMethod and Description
public int
public boolean
public boolean

Returns:

whether nulls should sort low
getIsNullsOrderedLow
()

Implements org.apache.derby.iapi.store.access.ColumnOrdering.getIsNullsOrderedLow.

Indicate whether NULL values should be ordered below non-NULL.

public int

Returns:

the formatID of this class
getTypeFormatId
()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get the formatID which corresponds to this class.

public void
readExternal(ObjectInput
read this.
in
)

Implements java.io.Externalizable.readExternal.

Read this object from a stream of stored objects.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
writeExternal(ObjectOutput
write bytes here
out
)

Implements java.io.Externalizable.writeExternal.

Write this object out

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

ascendingback to summary
pack-priv boolean ascending
colNumback to summary
pack-priv 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.

nullsOrderedLowback to summary
pack-priv 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

IndexColumnOrderback to summary
public IndexColumnOrder()

Niladic constructor for formatable

IndexColumnOrderback to summary
public IndexColumnOrder(int colNum)
IndexColumnOrderback to summary
public IndexColumnOrder(int colNum, boolean ascending)
IndexColumnOrderback to summary
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:int

number of this column

ascending:boolean

whether the ORDER BY is ascendeing or descending

nullsLow:boolean

whether nulls should be ordered low

Method Detail

getColumnIdback to summary
public int getColumnId()

Implements org.apache.derby.iapi.store.access.ColumnOrdering.getColumnId.

getIsAscendingback to summary
public boolean getIsAscending()

Implements org.apache.derby.iapi.store.access.ColumnOrdering.getIsAscending.

getIsNullsOrderedLowback to summary
public boolean getIsNullsOrderedLow()

Implements org.apache.derby.iapi.store.access.ColumnOrdering.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.

Returns:boolean

whether nulls should sort low

getTypeFormatIdback to summary
public int getTypeFormatId()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get the formatID which corresponds to this class.

Returns:int

the formatID of this class

readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Read this object from a stream of stored objects.

Parameters
in:ObjectInput

read this.

Exceptions
IOException:
thrown on error
ClassNotFoundException:
thrown on error
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Write this object out

Parameters
out:ObjectOutput

write bytes here

Exceptions
IOException:
thrown on error