atg.projects.store.repository.servlet
Class PossibleValueComparator

java.lang.Object
  extended by atg.projects.store.repository.servlet.PossibleValueComparator
All Implemented Interfaces:
java.util.Comparator<atg.repository.servlet.PossibleValues.PossibleValue>

public class PossibleValueComparator
extends java.lang.Object
implements java.util.Comparator<atg.repository.servlet.PossibleValues.PossibleValue>

Comparator class for PossibleValue objects. Sorts PossibleValue objects alphabetically by their labels (or localized labels for EnumeratedOptionPossibleValue type) with the exception that the possible value which settableValue is the same as firstElementValue will be always at the beginning of the list and possible value with settableValue the same as in lastElementValue property will be always at the end of the list.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
PossibleValueComparator()
           
 
Method Summary
 int compare(atg.repository.servlet.PossibleValues.PossibleValue pObj1, atg.repository.servlet.PossibleValues.PossibleValue pObj2)
          Compares two PossibleValue objects alphabetically by their labels (or localized labels for EnumeratedOptionPossibleValue type) with the exception that the possible value which settableValue is the same as firstElementValue will be always at the beginning of the list and possible value with settableValue the same as in lastElementValue property will be always at the end of the list.
 java.lang.String getFirstElementValue()
          Gets the element value that always should be put at the beginning of the list
 java.lang.String getLastElementValue()
          Gets the element value that always should be put at the end of the list
 void setFirstElementValue(java.lang.String pFirstElementValue)
          Sets the element value that always should be put at the beginning of the list.
 void setLastElementValue(java.lang.String pLastElementValue)
          Sets the element value that always should be put at the end of the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

PossibleValueComparator

public PossibleValueComparator()
Method Detail

getFirstElementValue

public java.lang.String getFirstElementValue()
Gets the element value that always should be put at the beginning of the list

Returns:
the element value that always should be put at the beginning of the list

setFirstElementValue

public void setFirstElementValue(java.lang.String pFirstElementValue)
Sets the element value that always should be put at the beginning of the list.

Parameters:
pFirstElementValue - - the element value that always should be put at the beginning of the list.

getLastElementValue

public java.lang.String getLastElementValue()
Gets the element value that always should be put at the end of the list

Returns:
the element value that always should be put at the end of the list

setLastElementValue

public void setLastElementValue(java.lang.String pLastElementValue)
Sets the element value that always should be put at the end of the list.

Parameters:
pLastElementValue - - the element value that always should be put at the end of the list.

compare

public int compare(atg.repository.servlet.PossibleValues.PossibleValue pObj1,
                   atg.repository.servlet.PossibleValues.PossibleValue pObj2)
Compares two PossibleValue objects alphabetically by their labels (or localized labels for EnumeratedOptionPossibleValue type) with the exception that the possible value which settableValue is the same as firstElementValue will be always at the beginning of the list and possible value with settableValue the same as in lastElementValue property will be always at the end of the list.

Specified by:
compare in interface java.util.Comparator<atg.repository.servlet.PossibleValues.PossibleValue>