com.sas.dataselectors.filters
Class DefaultFilterValueList

com.sas.dataselectors.filters.DefaultFilterValueList
All Implemented Interfaces:
FilterValuesInterface

public class DefaultFilterValueList
implements FilterValuesInterface

The default implementation of FilterValuesInterface, this class is used by the filter model to hold and maintain a list of values.


Field Summary
protected  java.util.Collection _itemValues
          The list of values.
protected  java.util.Iterator _itemValuesIterator
          An iterator used internal to access values in the list.
protected  java.lang.String _label
          The label for this value list.
static java.lang.String RB_KEY
          The resource key prefix used when retrieving properties for this class.
 
Fields inherited from interface com.sas.dataselectors.filters.FilterValuesInterface
GETTHRESHHOLDALLVALUES
 
Constructor Summary
DefaultFilterValueList(java.util.Collection itemValues)
          Constructs a new filter value list holding the contents of the given collection as its initial values.
DefaultFilterValueList(java.lang.Object[] itemValues)
          Constructs a new filter value list holding the contents of the given array of objects as its initial values.
 
Method Summary
 java.util.List getFirstValues(long lThreshold)
          Returns the first group in a list of objects for an Item.
 java.lang.String getListLabel()
          Returns the current label for this list of values.
 java.util.List getNextValues(long lThreshold)
          Returns the next group in a list of objects for an Item.
 boolean hasMoreValues()
          Returns TRUE as long as there remain values to be retrieved from the datasource.
 void setListLabel(java.lang.String value)
          Allows setting a label for this list of values.
 java.lang.String toString()
          Returns a text label for this list.
 

Field Detail

RB_KEY

public static java.lang.String RB_KEY
The resource key prefix used when retrieving properties for this class.


_label

protected transient java.lang.String _label
The label for this value list.


_itemValues

protected java.util.Collection _itemValues
The list of values.


_itemValuesIterator

protected java.util.Iterator _itemValuesIterator
An iterator used internal to access values in the list.

Constructor Detail

DefaultFilterValueList

public DefaultFilterValueList(java.util.Collection itemValues)
Constructs a new filter value list holding the contents of the given collection as its initial values.

Parameters:
itemValues - the initial values for the list

DefaultFilterValueList

public DefaultFilterValueList(java.lang.Object[] itemValues)
Constructs a new filter value list holding the contents of the given array of objects as its initial values.

Parameters:
itemValues - the initial values for the list
Method Detail

hasMoreValues

public boolean hasMoreValues()
Returns TRUE as long as there remain values to be retrieved from the datasource.

Specified by:
hasMoreValues in interface FilterValuesInterface
Returns:
TRUE if more values are available

getFirstValues

public java.util.List getFirstValues(long lThreshold)
                              throws DataRetrievalError
Returns the first group in a list of objects for an Item. The toString() of these objects will be displayed to the user and the actual object will be returned as part of the selected filter data. If a threshold of 0 is used then all values should be returned.

Specified by:
getFirstValues in interface FilterValuesInterface
Parameters:
lThreshold - the maximum number of values to return
Returns:
the first set of values in this list
Throws:
DataRetrievalError - if an error prevented returning any values
See Also:
FilterValuesInterface.GETTHRESHHOLDALLVALUES

getNextValues

public java.util.List getNextValues(long lThreshold)
                             throws DataRetrievalError
Returns the next group in a list of objects for an Item. If a threshold of 0 is used then all the remaining values should be returned.

Specified by:
getNextValues in interface FilterValuesInterface
Parameters:
lThreshold - the maximum number of values to return
Returns:
the next set of values in this list
Throws:
DataRetrievalError - if an error prevented returning any values

setListLabel

public void setListLabel(java.lang.String value)
Allows setting a label for this list of values.

Parameters:
value - The new label for this list

getListLabel

public java.lang.String getListLabel()
Returns the current label for this list of values.

Specified by:
getListLabel in interface FilterValuesInterface
Returns:
the label for this list

toString

public java.lang.String toString()
Returns a text label for this list.

Overrides:
toString in class java.lang.Object
Returns:
text for this list



Copyright © 2009 SAS Institute Inc. All Rights Reserved.