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

# Class SortKey

java.lang.Object
org.eclipse.birt.report.model.core.Structure
org.eclipse.birt.report.model.api.elements.structures.SortKey

All Implemented Interfaces:
  `Cloneable`, `IStructure`, `org.eclipse.birt.report.model.core.IPropertySet`

public class SortKey extends org.eclipse.birt.report.model.core.Structure
This class represents a 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
Modifier and Type
Field
Description
`static final String`
`DIRECTION_MEMBER`
Name of the "direction" member.
`static final String`
`KEY_MEMBER`
Name of the "key" member.
`static final String`
`LOCALE_MEMBER`
Name of the member that defines the locale of the sort collation.
`static final String`
`SORT_STRUCT`
Name of this structure.
`static final String`
`STRENGTH_MEMBER`
Name of the member that defines the strength of the sort collation.

## Constructor Summary

Constructors
Constructor
Description
`SortKey()`
Default constructor.
`SortKey(String key, String direction)`
Constructs the sort key with the key to sort and the direction.

## Method Summary

Modifier and Type
Method
Description
`String`
`getColumnName()`
Deprecated.
This property has been removed.
`String`
`getDirection()`
Returns the sort direction.
`protected Object`
`getIntrinsicProperty(String propName)`
Returns the value of a structure property represented as a member variable.
`String`
`getKey()`
Returns the expression that gives the sort key on which to sort.
`com.ibm.icu.util.ULocale`
`getLocale()`
Gets the locale of this sort.
`int`
`getStrength()`
Gets the strength of the sort collation.
`String`
`getStructName()`
Returns the name of the structure definition.
`StructureHandle`
`handle(SimpleValueHandle valueHandle, int index)`
Creates the specific handle of this structure.
`void`
`setColumnName(String columnName)`
Deprecated.
This property has been removed.
`void`
`setDirection(String direction)`
Sets the sort direction.
`protected void`
`setIntrinsicProperty(String propName, Object value)`
Sets the value of of a structure property represented as a member variable.
`void`
`setKey(String key)`
Sets the expression that gives the sort key on which to sort.
`void`
`setLocale(com.ibm.icu.util.ULocale locale)`
Sets the locale of this sort.
`void`
`setStrength(int strength)`
Sets the strength of this sort collation.
`List`
`validate(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)`
Validate whether this structure is valid.

### Methods inherited from class org.eclipse.birt.report.model.core.Structure

`checkStringMember, copy, equals, getCompatibleValue, getContext, getDefn, getElement, getExpressionProperty, getHandle, getHandle, getLocalProperty, getLocalProperty, getMemberDefn, getObjectDefn, getProperty, getProperty, getReferencableProperty, getStringProperty, isDesignTime, isReferencable, setContext, setExpressionProperty, setProperty, setProperty, setupContext, updateReference`

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

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

## Field Details

### SORT_STRUCT

public static final String SORT_STRUCT
Name of this structure. Matches the definition in the meta-data dictionary.

See Also:
  - Constant Field Values

### KEY_MEMBER

public static final String KEY_MEMBER
Name of the "key" member. An expression that gives the sort key on which to sort.

See Also:
  - Constant Field Values

### DIRECTION_MEMBER

public static final String DIRECTION_MEMBER
Name of the "direction" member.

See Also:
  - Constant Field Values

### STRENGTH_MEMBER

public static final String STRENGTH_MEMBER
Name of the member that defines the strength of the sort collation.

See Also:
  - Constant Field Values

### LOCALE_MEMBER

public static final String LOCALE_MEMBER
Name of the member that defines the locale of the sort collation.

See Also:
  - Constant Field Values

## Constructor Details

### SortKey

public SortKey(String key, String direction)
Constructs the sort key with the key to sort and the direction.

Parameters:
  `key` - the key of the sort entry
  `direction` - sort direction: Ascending or descending order

### SortKey

public SortKey()
Default constructor.

## Method Details

### getStructName

public String getStructName()
Description copied from interface: `IStructure`
Returns the name of the structure definition. The name is the one used to define the structure in the meta-data dictionary.

Returns:
  the internal name of the structure a defined in the meta-data dictionary.

### getIntrinsicProperty

protected Object getIntrinsicProperty(String propName)
Description copied from class: `org.eclipse.birt.report.model.core.Structure`
Returns the value of a structure property represented as a member variable.

Specified by:
  `getIntrinsicProperty` in class `org.eclipse.birt.report.model.core.Structure`
Parameters:
  `propName` - name of the property
Returns:
  the value of the property, or null if the property is not set

### setIntrinsicProperty

protected void setIntrinsicProperty(String propName, Object value)
Description copied from class: `org.eclipse.birt.report.model.core.Structure`
Sets the value of of a structure property represented as a member variable.

Specified by:
  `setIntrinsicProperty` in class `org.eclipse.birt.report.model.core.Structure`
Parameters:
  `propName` - the name of the property to set
  `value` - the property value

### getKey

public String getKey()
Returns the expression that gives the sort key on which to sort.

Returns:
  the sort key on which to sort

### setKey

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

Parameters:
  `key` - the sort key to set

### 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 sort direction

### setDirection

public void setDirection(String direction)
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

### getStrength

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

Returns:
  the strength of the sort

### setStrength

public void setStrength(int strength)
Sets the strength of this sort collation.

Parameters:
  `strength` -

### getLocale

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

Returns:
  locale of this sort

### setLocale

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

Parameters:
  `locale` - the locale to set

### handle

public StructureHandle handle(SimpleValueHandle valueHandle, int index)
Description copied from class: `org.eclipse.birt.report.model.core.Structure`
Creates the specific handle of this structure. This handle is always created.

Specified by:
  `handle` in class `org.eclipse.birt.report.model.core.Structure`
Parameters:
  `valueHandle` - the value handle of this structure list property this structure is in
  `index` - the position of this structure in structure list
Returns:
  the handle of this structure.

### 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)
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

### validate

public List validate(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)
Description copied from class: `org.eclipse.birt.report.model.core.Structure`
Validate whether this structure is valid. The derived class should override this method if semantic check is needed. The each error is the instance of `PropertyValueException`.

Overrides:
  `validate` in class `org.eclipse.birt.report.model.core.Structure`
Parameters:
  `module` - the module
  `element` - the element contains this structure
Returns:
  the semantic error list