com.sas.dataselectors.filters
Class FilterItemRootToSimpleList

com.sas.dataselectors.filters.FilterItemRootToSimpleList
All Implemented Interfaces:
SimpleLogicListInterface, java.lang.Iterable, java.util.Collection, java.util.List

public class FilterItemRootToSimpleList

This class converts a Filter that may be a compound filter into a simple list of test nodes (via the FilterItemSimpleTree class).


Field Summary
 
Fields inherited from class com.sas.dataselectors.filters.AbstractFilterItemSimpleListBase
_filterItemList, _filterTestNodeList
 
Constructor Summary
FilterItemRootToSimpleList(com.sas.iquery.metadata.business.FilterItem rootFilterItem, FilterItemListInterface filterItemList, boolean enforceAsAllSameType, FilterObjectFactoryInterface filterObjectFactory)
          Constructs a new simple list from the given parameters.
 
Method Summary
protected  void addTestNodeAt(int index, FilterLogicTestNodeInterface testNode)
          Adds the given test node at the specified location in the list.
 boolean commitChanges()
          Commits any changes in the filter model to the underlying native model.
 java.lang.Object getRootFilterObject()
          Returns the native filter object.
protected  java.lang.Object getTestNodeAt(int index)
          Returns the test node at the specified location in the list.
protected  java.lang.Object removeTestNodeAt(int index)
          Removes and returns the test node at the specified index in the list.
protected  java.lang.Object setTestNodeAt(int index, FilterLogicTestNodeInterface testNode)
          Assigns the given test node at the specified location in the list.
 
Methods inherited from class com.sas.dataselectors.filters.AbstractFilterItemSimpleListBase
add, add, addAll, addAll, clear, contains, containsAll, equals, get, getFilterItemList, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Constructor Detail

FilterItemRootToSimpleList

public FilterItemRootToSimpleList(com.sas.iquery.metadata.business.FilterItem rootFilterItem,
                                  FilterItemListInterface filterItemList,
                                  boolean enforceAsAllSameType,
                                  FilterObjectFactoryInterface filterObjectFactory)
Constructs a new simple list from the given parameters.

Parameters:
rootFilterItem - the native filter item to process
filterItemList - the list of filter items in the filter model
enforceAsAllSameType - flag for restricting logical conditions
filterObjectFactory - the object factory used during model conversions
Method Detail

commitChanges

public boolean commitChanges()
Commits any changes in the filter model to the underlying native model.

Specified by:
commitChanges in interface SimpleLogicListInterface
Specified by:
commitChanges in class AbstractFilterItemSimpleListBase
Returns:
true if the native model was successfully updated, false otherwise

getRootFilterObject

public java.lang.Object getRootFilterObject()
Returns the native filter object.

Specified by:
getRootFilterObject in interface SimpleLogicListInterface
Specified by:
getRootFilterObject in class AbstractFilterItemSimpleListBase
Returns:
the native filter object

setTestNodeAt

protected java.lang.Object setTestNodeAt(int index,
                                         FilterLogicTestNodeInterface testNode)
Assigns the given test node at the specified location in the list.

Overrides:
setTestNodeAt in class AbstractFilterItemSimpleListBase
Parameters:
index - the index in the list to assign the test node
testNode - the test node to assign to the list
Returns:
the test node previously occupying the specified index in the list

removeTestNodeAt

protected java.lang.Object removeTestNodeAt(int index)
Removes and returns the test node at the specified index in the list.

Overrides:
removeTestNodeAt in class AbstractFilterItemSimpleListBase
Parameters:
index - the index in the list of the target test node
Returns:
the test node that was removed from the list

addTestNodeAt

protected void addTestNodeAt(int index,
                             FilterLogicTestNodeInterface testNode)
Adds the given test node at the specified location in the list.

Overrides:
addTestNodeAt in class AbstractFilterItemSimpleListBase
Parameters:
index - the index in the list to add the test node
testNode - the test node to assign to the list

getTestNodeAt

protected java.lang.Object getTestNodeAt(int index)
Returns the test node at the specified location in the list.

Overrides:
getTestNodeAt in class AbstractFilterItemSimpleListBase
Parameters:
index - the index in the list of the target test node
Returns:
the test node



Copyright © 2009 SAS Institute Inc. All Rights Reserved.