borland Packages  Class Hierarchy  jbcl.dataset Package  Index 

SortDescriptor class

java.lang.Object
   +----borland.jbcl.dataset.SortDescriptor

About the SortDescriptor class

Constructors  Properties  Methods  

Implements Serializable, Cloneable

The SortDescriptor component describes the order by which rows of data that are visible to a DataSet are accessed and presented. Sorting data in the JBCL is very easy and fast since indexes are built as they are needed.

The DataSet can automatically reposition a new or updated row within the cursor based on the ordering of data by specified columns. In such instances, a row may "fly-away" to its correct position in the DataSet.

In an ascending sort, null values appear at the bottom of the sort order.

There are no write-accessors for properties of the SortDescriptor. To set its properties, use a SortDescriptor constructor that takes the appropriate property as a parameter.


SortDescriptor constructors

SortDescriptor properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

SortDescriptor methods

Methods implemented in this class

Methods implemented in java.lang.Object


SortDescriptor constructors

SortDescriptor(borland.jbcl.dataset.SortDescriptor)

  public SortDescriptor(borland.jbcl.dataset.SortDescriptor descriptor)
Constructs a SortDescriptor that contains the same values as the specified SortDescriptor.

Parameters:

descriptor
The SortDescriptor to clone properties values from.

SortDescriptor(java.lang.String)

  public SortDescriptor(java.lang.String sortKey)
Constructs a SortDescriptor with the specified sort. Defaults to case-sensitive, ascending.

Parameters:

sortKey
The String name of the Column by which to sort the data.

SortDescriptor(java.lang.String[])

  public SortDescriptor(java.lang.String[] sortKeys)
Constructs a SortDescriptor with the specified sort keys. Defaults to case sensitive, ascending. Case-sensitivity applies for all specified String columns. Ascending/descending applies to all specified columns.

Parameters:

sortKeys
The String array containing the names of the Column components by which to sort the data.

SortDescriptor(java.lang.String[], boolean, boolean)

  public SortDescriptor(java.lang.String[] sortKeys, boolean caseInsensitive, boolean descending)
Constructs a SortDescriptor with properties as specified in its parameters.

Parameters:

sortKeys
The String array containing the names of the Column components by which to sort the data.
caseInsensitive
Whether the sort considers (false) or ignores (true) upper and lower case differences. Valid only for String columns. Defaults to false (case sensitive).
descending
Whether the sort is in ascending (false, the default) or descending (true) order.

SortDescriptor(java.lang.String[], boolean, boolean, java.lang.String)

  public SortDescriptor(java.lang.String[] sortKeys, boolean caseInsensitive, boolean descending, java.lang.String localeName)
Constructs a SortDescriptor with properties as specified in its parameters.

Parameters:

sortKeys
The String array containing the names of the Column components by which to sort the data.
caseInsensitive
Whether the sort considers (false) or ignores (true) upper and lower case differences. Valid only for String columns. Defaults to false (case sensitive).
descending
Whether the sort is in ascending (false, the default) or descending (true) order.
localeName
The String name of the locale used for sorting of the data in the DataSet.

SortDescriptor properties

caseInsensitive

 public final boolean isCaseInsensitive()
Read-only property that returns whether the sort considers (false) or ignores (true) upper and lower case differences. Valid only for String columns. This property applies to all applicable String columns specified in the keys property.

descending

 public final boolean isDescending()
Read-only property that returns whether the sort is in ascending (false) or descending (true) order. This property applies to all applicable columns specified in the keys property.

keys

 public final String[] getKeys()
Read-only property that returns the String array containing the names of the Column components by which the data is sorted.

localeName

 public final String getLocaleName()

Returns or specifies the String name of the locale used for sorting of the data in a DataSet.


SortDescriptor methods

equals(borland.jbcl.dataset.SortDescriptor)

  public final boolean equals(borland.jbcl.dataset.SortDescriptor descriptor)
Determines whether the SortDescriptor contains the same property values as the specified SortDescriptor.

Parameters:

descriptor
The SortDescriptor to compare property values against.

keyCount()

  public final int keyCount()
Returns the number of Column components involved in the sort.

toString()

  public String toString()
Returns the String representation of the values stored in the SortDescriptor.

Overrides: java.lang.Object.toString()