com.sap.tc.cmi.sorting

Class CMISortCriteriaList

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

public final class CMISortCriteriaList
extends CMISortCriterion
implements Serializable

(Complex) sort criterion that consists of a prioritized list of (simpler) SortCriteria.

The contained sort criteria are indexed in descending priority. So ICMISortables have to sort data by the criterion with index 0 first, then by the criterion with index 1 and so on.

This list is immutable, so the existing mutator methods all return a new, modified copy of this list.

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
CMISortCriteriaList(CMISortCriterion[] sortCriteria)
          Creates a list of sort criteria from the array sortCriteria where the sort priority is defined by the index of criteria in the array (the sort criterion with index 0 has highest priority).
 
Method Summary
 CMISortCriteriaList add(CMISortCriterion sortCriterion)
          Returns a list of sort criteria where the sort criterion given as parameter is added at the end.
 CMISortCriteriaList add(int index, CMISortCriterion sortCriterion)
          Returns a list of sort criteria where the sort criterion given as parameter is added at the specified index.
 boolean equals(CMISortCriteriaList other)
           
 boolean equals(Object other)
           
 CMISortCriterion getCriterion(int index)
          Returns the sort criterion with the given index.
 int hashCode()
           
 CMISortCriteriaList remove(int index)
          Returns a list of sort criteria where the sort criterion at the specified index is removed.
 int size()
          Get the number of sort criteria contained in this sort criteria list.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CMISortCriteriaList

public CMISortCriteriaList(CMISortCriterion[] sortCriteria)
Creates a list of sort criteria from the array sortCriteria where the sort priority is defined by the index of criteria in the array (the sort criterion with index 0 has highest priority).

Parameters:
sortCriteria - The array of sort criteria.
Method Detail

size

public int size()
Get the number of sort criteria contained in this sort criteria list.

Returns:
Number of sort criteria.

getCriterion

public CMISortCriterion getCriterion(int index)
Returns the sort criterion with the given index. If index < 0 or index > size()-1 an ArrayIndexOutOfBoundsException is thrown.

Parameters:
index - The index of the sort criterion in the list.
Returns:
The sort criterion.

add

public CMISortCriteriaList add(CMISortCriterion sortCriterion)
Returns a list of sort criteria where the sort criterion given as parameter is added at the end. Note: As CMISortCriteriaList is immutable this is a new list; the sort criteria list this method has been called on is not modified.

Parameters:
sortCriterion - The sort criterion to be added.
Returns:
The newly created sort criteria list with the criterion added.

add

public CMISortCriteriaList add(int index,
                               CMISortCriterion sortCriterion)
Returns a list of sort criteria where the sort criterion given as parameter is added at the specified index. Note: As CMISortCriteriaList is immutable this is a new list; the sort criteria list this method has been called on is not modified.

Parameters:
sortCriterion - The sort criterion to be added.
Returns:
The newly created sort criteria list with the criterion added.

remove

public CMISortCriteriaList remove(int index)
Returns a list of sort criteria where the sort criterion at the specified index is removed. Note: As CMISortCriteriaList is immutable this is a new list; the sort criteria list this method has been called on is not modified.

Parameters:
index - The index where to remove a criterion.
Returns:
The newly created sort criteria list with the criterion removed.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

equals

public boolean equals(CMISortCriteriaList 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