|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.datatools.connectivity.oda.SortSpec
A class that encapsulates one or more sort keys for association with an IQuery. The class is designed to be extendable to accommodate additional ways of expressing a sort mode or key.
Field Summary | |
static int |
sortAsc
The constant indicating ascending sort order. |
static int |
sortDesc
The constant indicating descending sort order. |
Constructor Summary | |
SortSpec(int sortMode)
Instantiates a SortSpec object for the defined
sortMode . |
Method Summary | |
void |
addSortKey(java.lang.String columnName,
int sortOrder)
Specifies the dynamic sort criteria in this sort mode. |
java.lang.String |
getSortColumn(int index)
Returns the result set column name of the sort key at the index
position. |
java.lang.String[] |
getSortColumns()
Returns an array of all column names for the sort key of a sortModeSingleOrder SortSpec object. |
int |
getSortKeyCount()
Returns the number of sort keys associated with this SortSpec
object. |
int |
getSortMode()
Returns the sort mode of this SortSpec object. |
int |
getSortOrder()
Returns the sort order for the sort keys of a sortModeSingleOrder
SortSpec object. |
int |
getSortOrder(int index)
Returns the sort order of the sort key at the index position. |
void |
setLocale(ULocale locale)
Deprecated. obsolete; migrated to use NLS Messages class |
java.lang.String |
toString()
Returns a string representation of this SortSpec . |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int sortAsc
public static final int sortDesc
Constructor Detail |
public SortSpec(int sortMode)
SortSpec
object for the defined
sortMode
.
sortMode
- the sort mode of this SortSpec
; one of
IDataSetMetaData.sortModeNone
,
IDataSetMetaData.sortModeSingleOrder
,
IDataSetMetaData.sortModeColumnOrder
,
IDataSetMetaData.sortModeSingleColumn
.
java.lang.IllegalArgumentException
- if the sortMode
is not a
valid value.Method Detail |
public void addSortKey(java.lang.String columnName, int sortOrder)
SortSpec
's sortMode;
i.e. the method throws an exception when adding a sort key that does not
conform to the sortMode of this SortSpec
object.
columnName
- name of the result set column to apply dynamic sorting
on. The specified column should be one of the columns
retrieved in a result set.sortOrder
- value that represents the sorting order; one of
sortAsc
, sortDesc
.
java.lang.NullPointerException
- if columnName
is null.
java.lang.IllegalArgumentException
- if columnName
is empty; or if
sortOrder
is not sortAsc
or sortDesc
.
java.lang.IllegalStateException
- if the sortMode of this SortSpec
is IDataSetMetaData.sortModeNone
;
or if the sortMode of this SortSpec
is IDataSetMetaData.sortModeSingleColumn
,
and a sort key is already associated; or if the
sortMode of this SortSpec
is
IDataSetMetaData.sortModeSingleOrder
and the sort order does not match existing sort orders.public int getSortMode()
SortSpec
object.
SortSpec
; one of
IDataSetMetaData.sortModeNone
,
IDataSetMetaData.sortModeSingleOrder
,
IDataSetMetaData.sortModeColumnOrder
,
IDataSetMetaData.sortModeSingleColumn
.public int getSortKeyCount()
SortSpec
object.
SortSpec
object.public java.lang.String getSortColumn(int index)
index
position.
index
- index of the sort key (1-based).
java.lang.IndexOutOfBoundsException
- if index
is out of range
(index < 1 || index > getSortKeyCount()).public int getSortOrder(int index)
index
position.
index
- index of the sort key (1-based).
java.lang.IndexOutOfBoundsException
- if index
is out of range
(index < 1 || index > getSortKeyCount()).public java.lang.String[] getSortColumns()
sortModeSingleOrder
SortSpec
object.
sortModeSingleOrder
SortSpec
object; an empty array if no sort keys are associated
with this SortSpec
.
java.lang.IllegalStateException
- if this SortSpec
's sort
mode is not sortModeSingleOrder
.public int getSortOrder()
sortModeSingleOrder
SortSpec
object.
sortModeSingleOrder
SortSpec
object; the default value, sortAsc
,
if no sort keys are associated with this SortSpec
.
java.lang.IllegalStateException
- if this SortSpec
's sort
mode is not sortModeSingleOrder
.public void setLocale(ULocale locale)
SortSpec
. Enables this SortSpec
to return localized error messages. The default locale is en_US
.
locale
- the locale used for localizing error messages.public java.lang.String toString()
SortSpec
.
SortSpec
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |