net.sf.chainedoptions.support
Class NoSortStrategy

java.lang.Object
  extended by net.sf.chainedoptions.support.NoSortStrategy
All Implemented Interfaces:
ChainedOptionStrategy

public class NoSortStrategy
extends java.lang.Object
implements ChainedOptionStrategy

Strategy that does not perform any sorting and returns the first item in the list as default value.

Author:
Mattias Arthursson

Constructor Summary
NoSortStrategy()
           
 
Method Summary
 java.util.List adjustAndSort(java.util.List options, java.lang.Object context)
          Do nothing, just return the supplied list.
 java.lang.String getDefaultValue(java.util.List options, java.lang.Object context)
          Returns the value of the first item in the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoSortStrategy

public NoSortStrategy()
Method Detail

adjustAndSort

public java.util.List adjustAndSort(java.util.List options,
                                    java.lang.Object context)
Do nothing, just return the supplied list.

Specified by:
adjustAndSort in interface ChainedOptionStrategy
Parameters:
options - the list to return.
context - ignored for this implementation.
Returns:
the supplied list, unmodified.
See Also:
LabelValueBean

getDefaultValue

public java.lang.String getDefaultValue(java.util.List options,
                                        java.lang.Object context)
Returns the value of the first item in the list.

Specified by:
getDefaultValue in interface ChainedOptionStrategy
Parameters:
options - the list of options.
context - ignored for this implementation.
Returns:
the value of the first item in the List if the List is not empty, empty String otherwise.


Copyright ? 2005. All Rights Reserved.