com.sap.tc.cmi.sorting

Class CMISortByColumn

java.lang.Object
  extended by com.sap.tc.cmi.sorting.CMISortCriterion
      extended by com.sap.tc.cmi.sorting.CMISortByColumn
All Implemented Interfaces:
Serializable

public final class CMISortByColumn
extends CMISortCriterion
implements Serializable

Instructs a collection to order its data by the value of a single column. The column is identified by its name. The way how the data is to be sorted is described by the (optional) comparison rule and a boolean flag reverse indicates whether the order defined by the comparison rule has to be reversed.

The term 'column' has been chosen instead of 'property' or 'attribute' as sorting is not necessarily restricted to data that is part of a model class. There might even be contexts where SortCriterion is used without any model class (e.g. ValueNode in Web Dynpro Context).

Objects of this type are immutable, so the existing mutator methods all return a new, modified copy of this CMISortByColumn object.

Since:
NW Paris MS2
See Also:
Serialized Form

Type Classification Type Classification:

This class is part of the Common Model Interface, so applications may reference it or call any method of this type, but they must not subclass it.


Field Summary
 
Fields inherited from class com.sap.tc.cmi.sorting.CMISortCriterion
NONE
 
Constructor Summary
CMISortByColumn(String columnName)
          Creates a column sort criterion for the column name given.
CMISortByColumn(String columnName, boolean reversed)
          Creates a column sort criterion with the column name and sort order reversal defined by the parameters.
 
Method Summary
 CMISortByColumn changeColumnName(String columnName)
          Returns a new CMISortByColumn instance as copy of this instance where the column name has been changed to columnName.
 CMISortByColumn changeDirection(boolean reversed)
          Returns a new CMISortByColumn instance as copy of this instance where the reversed sort order flag is changed to reversed.
 boolean equals(CMISortByColumn other)
           
 boolean equals(Object other)
           
 String getColumnName()
          Get the column name of this sort criterion.
 CMIComparisonRule getComparisonRule()
          Get the comparison rule of this sort criterion.
 int hashCode()
           
 boolean isReversed()
          Get the flag for reversed sort order for this sort criterion.
 CMISortByColumn reverse()
          Returns a new CMISortByColumn instance as copy of this instance where the sort order reverse flag is inverted.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CMISortByColumn

public CMISortByColumn(String columnName)
Creates a column sort criterion for the column name given. The sort order is not reversed and the comparison rule is set to CMIComparisonRule.MODEL_DEFINED.

Parameters:
columnName - Column name

CMISortByColumn

public CMISortByColumn(String columnName,
                       boolean reversed)
Creates a column sort criterion with the column name and sort order reversal defined by the parameters. The comparison rule is set to CMIComparisonRule.MODEL_DEFINED.

Parameters:
columnName - Column name
reversed - Flag if sort order is to be reversed
Method Detail

getColumnName

public String getColumnName()
Get the column name of this sort criterion.

Returns:
Column name

getComparisonRule

public CMIComparisonRule getComparisonRule()
Get the comparison rule of this sort criterion.

Returns:
Comparison rule.

isReversed

public boolean isReversed()
Get the flag for reversed sort order for this sort criterion.

Returns:
Reversed sort order flag.

changeColumnName

public CMISortByColumn changeColumnName(String columnName)
Returns a new CMISortByColumn instance as copy of this instance where the column name has been changed to columnName.

Returns:
A new, changed column sort criterion

changeDirection

public CMISortByColumn changeDirection(boolean reversed)
Returns a new CMISortByColumn instance as copy of this instance where the reversed sort order flag is changed to reversed.

Returns:
A new, changed column sort criterion

reverse

public CMISortByColumn reverse()
Returns a new CMISortByColumn instance as copy of this instance where the sort order reverse flag is inverted.

Returns:
A new, changed column sort criterion

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

equals

public boolean equals(CMISortByColumn other)
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] FRAMEWORK [sap.com] tc/cm/ejb/api api BC-JAS-EJB
[sap.com] FRAMEWORK [sap.com] tc/cmi default BC-WD-JAV-RUN


Copyright 2014 SAP AG Complete Copyright Notice