Package org.eclipse.birt.report.model.api

# Class SortKeyHandle

java.lang.Object
org.eclipse.birt.report.model.api.ElementDetailHandle
org.eclipse.birt.report.model.api.ValueHandle
org.eclipse.birt.report.model.api.StructureHandle
org.eclipse.birt.report.model.api.SortKeyHandle

public class SortKeyHandle extends StructureHandle
Represents the handle of sort key structure. The sort key is the sort entry for a table or list item, it defines the column and sort direction pair. Each sort key has the following properties:

Column Name
  the name of the column that is sorted.
Direction
  the sort direction:asc or desc.

## Field Summary

### Fields inherited from class org.eclipse.birt.report.model.api.StructureHandle

`structContext`

### Fields inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle

`elementHandle`

## Constructor Summary

Constructors
Constructor
Description
`SortKeyHandle(SimpleValueHandle valueHandle, int index)`
Constructs the handle of sort key.

## Method Summary

Modifier and Type
Method
Description
`String`
`getColumnName()`
Deprecated.
This property has been removed.
`String`
`getDirection()`
Returns the sort direction.
`String`
`getKey()`
Returns an expression that gives the sort key on which to sort.
`com.ibm.icu.util.ULocale`
`getLocale()`
Gets the locale of this sort collation.
`int`
`getStrength()`
Gets the strength of this sort collation.
`void`
`setColumnName(String columnName)`
Deprecated.
This property has been removed.
`void`
`setDirection(String direction)`
Sets the sort direction.
`void`
`setKey(String key)`
Sets an expression that gives the sort key on which to sort.
`void`
`setLocale(com.ibm.icu.util.ULocale locale)`
Sets the locale for this sort.
`void`
`setStrength(int strength)`
Sets the strength for this sort.

### Methods inherited from class org.eclipse.birt.report.model.api.StructureHandle

`drop, getContext, getDefn, getExpressionProperty, getExternalizedValue, getExternalizedValue, getIntProperty, getMember, getProperty, getPropertyDefn, getStringProperty, getStructure, isDesignTime, isLocal, iterator, setDesignTime, setExpressionProperty, setProperty, setPropertySilently`

### Methods inherited from class org.eclipse.birt.report.model.api.ValueHandle

`getReference`

### Methods inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle

`getDesign, getElement, getElementHandle, getModule`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SortKeyHandle

public SortKeyHandle(SimpleValueHandle valueHandle, int index)
Constructs the handle of sort key.

Parameters:
  `valueHandle` - the value handle for sort key list of one property
  `index` - the position of this sort key in the list

## Method Details

### getKey

public String getKey()
Returns an expression that gives the sort key on which to sort. The simplest case is the name of a column. The expression can also be an expression that includes columns. When used for a group, the expression can contain an aggregate computed over the group.

Returns:
  the key to sort
See Also:
  - `setKey(String)`

### setKey

public void setKey(String key) throws SemanticException
Sets an expression that gives the sort key on which to sort.

Parameters:
  `key` - the key to sort
Throws:
  `SemanticException` - value required exception
See Also:
  - `getKey()`

### getDirection

public String getDirection()
Returns the sort direction. The possible values are define in `DesignChoiceConstants`, and they are:

- SORT_DIRECTION_ASC
- SORT_DIRECTION_DESC

Returns:
  the direction to sort

### setDirection

public void setDirection(String direction) throws SemanticException
Sets the sort direction. The allowed values are define in `DesignChoiceConstants`, and they are:

- SORT_DIRECTION_ASC
- SORT_DIRECTION_DESC

Parameters:
  `direction` - the direction to set
Throws:
  `SemanticException` - if the direction is not in choice list.

### getColumnName

@Deprecated public String getColumnName()
Deprecated.
This property has been removed. See the method `getKey()`.
Returns the name of the column that needs sort.

Returns:
  the column name

### setColumnName

@Deprecated public void setColumnName(String columnName) throws SemanticException
Deprecated.
This property has been removed. See the method `setKey(String)`.
Sets the name of the column that needs sort.

Parameters:
  `columnName` - the column name to set
Throws:
  `SemanticException` - value required exception

### getStrength

public int getStrength()
Gets the strength of this sort collation. By default, it is -1.

Returns:
  the strength of this sort
See Also:
  - `setStrength(int)`

### setStrength

public void setStrength(int strength) throws SemanticException
Sets the strength for this sort.

Parameters:
  `strength` - the strength to sort
Throws:
  `SemanticException`
See Also:
  - `getStrength()`

### getLocale

public com.ibm.icu.util.ULocale getLocale()
Gets the locale of this sort collation.

Returns:
  the locale of this sort
See Also:
  - `setLocale(ULocale)`

### setLocale

public void setLocale(com.ibm.icu.util.ULocale locale) throws SemanticException
Sets the locale for this sort.

Parameters:
  `locale` - the locale to sort
Throws:
  `SemanticException`
See Also:
  - `getLocale()`