***  This class is subject to change   ***

com.sas.dataselectors.filters
Class AbstractFilterItemSimpleListBase

java.lang.Object
  |
  +--com.sas.dataselectors.filters.AbstractFilterItemSimpleListBase
All Implemented Interfaces:
SimpleLogicListInterface
Direct Known Subclasses:
FilterItemListToSimpleList, FilterItemRootToAdvancedList, FilterItemRootToSimpleList

public abstract class AbstractFilterItemSimpleListBase
extends java.lang.Object
implements SimpleLogicListInterface

This class is abstract implementation to manage a list of test nodes that are created from a filter item. A child class must decide how to populate the list.


Field Summary
protected  FilterItemListInterface _filterItemList
          The filter item list.
protected  List _filterTestNodeList
          The list of test nodes.
 
Constructor Summary
AbstractFilterItemSimpleListBase(FilterItemListInterface filterItemList)
          Constructor for AbstractFilterItemSimpleListBase.
 
Method Summary
 void add(int index, Object element)
          Adds the specified element at the specified position in the list by updating the underlying tree.
 boolean add(Object element)
          Ensures that this collection contains the specified element (optional operation).
 boolean addAll(Collection collection)
          Adds all of the elements in the specified collection to this collection (optional operation).
 boolean addAll(int index, Collection collection)
          Adds all items from the given collection to this list at the specified index.
 void clear()
          Removes all of the elements from this collection (optional operation).
abstract  boolean commitChanges()
          Commit any changes to the filter model and apply them to the native model.
 boolean contains(Object element)
           
 boolean containsAll(Collection collection)
          Returns true if this collection contains all of the elements in the specified collection.
 boolean equals(Object object)
          Compares the specified object with this collection for equality.
 Object get(int index)
          Returns the object at the specified index in the list.
 FilterItemListInterface getFilterItemList()
          The list of source items in the filter model.
abstract  Object getRootFilterObject()
          Returns the root filter object in the native model representing the completed filter selection.
 int hashCode()
           
 int indexOf(Object object)
          Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
 boolean isEmpty()
           
 Iterator iterator()
           
 int lastIndexOf(Object object)
          Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 Object remove(int index)
          Removes the object at the specified index from the list.
 boolean remove(Object object)
          Removes a single instance of the specified element from this collection, if it is present (optional operation).
 boolean removeAll(Collection collection)
          Removes all this collection's elements that are also contained in the specified collection (optional operation).
 boolean retainAll(Collection p1)
          Retains only the elements in this collection that are contained in the specified collection (optional operation).
 Object set(int index, Object element)
          Inserts the specified element at the specified position in this list by updating the underlying tree.
 int size()
           
 List subList(int startIndex, int endIndex)
          This method would produce a sublist of this list if it were supported.
 Object[] toArray()
           
 Object[] toArray(Object[] p1)
          Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_filterTestNodeList

protected List _filterTestNodeList
The list of test nodes.

_filterItemList

protected FilterItemListInterface _filterItemList
The filter item list.
Constructor Detail

AbstractFilterItemSimpleListBase

public AbstractFilterItemSimpleListBase(FilterItemListInterface filterItemList)
Constructor for AbstractFilterItemSimpleListBase. Because this class is abstract, the constructor can only be used by sub-classes.
Parameters:
filterItemList - the source list of filter items
Method Detail

commitChanges

public abstract boolean commitChanges()
Commit any changes to the filter model and apply them to the native model.
Specified by:
commitChanges in interface SimpleLogicListInterface
Returns:
true if everything succeeded

getRootFilterObject

public abstract Object getRootFilterObject()
Description copied from interface: SimpleLogicListInterface
Returns the root filter object in the native model representing the completed filter selection. This method should be called after using the commitChanges() method to construct the native filter.
Specified by:
getRootFilterObject in interface SimpleLogicListInterface
Returns:
the root filter object (a single filter item or a List)
Throws:
UnsupportedOperationException - if this is not the case

getFilterItemList

public FilterItemListInterface getFilterItemList()
The list of source items in the filter model.
Specified by:
getFilterItemList in interface SimpleLogicListInterface
Returns:
the filter item list

set

public Object set(int index,
                  Object element)
Inserts the specified element at the specified position in this list by updating the underlying tree.
Specified by:
set in interface List
Parameters:
index - the index for the element
element - the element to assign to the list
Returns:
the object previously assigned to the list at the specified index
See Also:
List.set(int, Object)

add

public void add(int index,
                Object element)
Adds the specified element at the specified position in the list by updating the underlying tree.
Specified by:
add in interface List
Parameters:
index - the index for the element
element - the element to add to the list
See Also:
List.add(int, Object)

remove

public Object remove(int index)
Removes the object at the specified index from the list.
Specified by:
remove in interface List
Parameters:
index - the index of the object
Returns:
the object removed

get

public Object get(int index)
Returns the object at the specified index in the list.
Specified by:
get in interface List
Parameters:
index - the index of the object
Returns:
the object at the given index

addAll

public boolean addAll(int index,
                      Collection collection)
Adds all items from the given collection to this list at the specified index.
Specified by:
addAll in interface List
Parameters:
index - the index in this list to begin inserting elements at
collection - the collection of elements to add to this list
Returns:
TRUE if elements were added to this list

containsAll

public boolean containsAll(Collection collection)
Returns true if this collection contains all of the elements in the specified collection.
Specified by:
containsAll in interface List
Parameters:
collection - the collection to be checked for containment in this collection.
Returns:
true if this collection contains all of the elements in the specified collection
Throws:
NullPointerException - if the specified collection is null.
See Also:
Collection.containsAll(Collection)

removeAll

public boolean removeAll(Collection collection)
Removes all this collection's elements that are also contained in the specified collection (optional operation). After this call returns, this collection will contain no elements in common with the specified collection.
Specified by:
removeAll in interface List
Parameters:
collection - the elements to be removed from this collection.
Returns:
true if this collection changed as a result of the call
Throws:
NullPointerException - if the specified collection is null.
See Also:
Collection.remove(Object), Collection.contains(Object), Collection.removeAll(Collection)

remove

public boolean remove(Object object)
Removes a single instance of the specified element from this collection, if it is present (optional operation). More formally, removes an element e such that (o==null ? e==null : o.equals(e)), if this collection contains one or more such elements. Returns true if this collection contained the specified element (or equivalently, if this collection changed as a result of the call).
Specified by:
remove in interface List
Parameters:
object - the element to be removed from this collection, if present.
Returns:
true if this collection changed as a result of the call
See Also:
Collection.remove(Object)

add

public boolean add(Object element)
Ensures that this collection contains the specified element (optional operation). Returns true if this collection changed as a result of the call. (Returns false if this collection does not permit duplicates and already contains the specified element.)

Collections that support this operation may place limitations on what elements may be added to this collection. In particular, some collections will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. Collection classes should clearly specify in their documentation any restrictions on what elements may be added.

If a collection refuses to add a particular element for any reason other than that it already contains the element, it must throw an exception (rather than returning false). This preserves the invariant that a collection always contains the specified element after this call returns.

Specified by:
add in interface List
Parameters:
element - the element whose presence in this collection is to be ensured.
Returns:
true if this collection changed as a result of the call
See Also:
Collection.add(Object)

clear

public void clear()
Removes all of the elements from this collection (optional operation). This collection will be empty after this method returns unless it throws an exception.
Specified by:
clear in interface List
See Also:
Collection.clear()

contains

public boolean contains(Object element)
Specified by:
contains in interface List
Parameters:
element - the element to search for
Returns:
TRUE if this collection contains the given element
See Also:
Collection.contains(Object)

iterator

public Iterator iterator()
Specified by:
iterator in interface List
Returns:
an Iterator for this collection
See Also:
Collection.iterator()

listIterator

public ListIterator listIterator()
Specified by:
listIterator in interface List
Returns:
a ListIterator for this collection
See Also:
List.listIterator()

listIterator

public ListIterator listIterator(int index)
Specified by:
listIterator in interface List
Parameters:
index - the initial position for the new iterator
Returns:
a ListIterator for this collection
See Also:
List.listIterator(int)

retainAll

public boolean retainAll(Collection p1)
Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection.
Specified by:
retainAll in interface List
Parameters:
c - elements to be retained in this collection.
Returns:
true if this collection changed as a result of the call
Throws:
NullPointerException - if the specified collection is null.
See Also:
remove(Object), contains(Object), Collection.retainAll(Collection)

addAll

public boolean addAll(Collection collection)
Adds all of the elements in the specified collection to this collection (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.)
Specified by:
addAll in interface List
Parameters:
c - elements to be inserted into this collection.
Returns:
true if this collection changed as a result of the call
See Also:
add(Object), Collection.addAll(Collection)

subList

public List subList(int startIndex,
                    int endIndex)
This method would produce a sublist of this list if it were supported.
Specified by:
subList in interface List
Parameters:
fromIndex - low endpoint (inclusive) of the subList.
toIndex - high endpoint (exclusive) of the subList.
Returns:
a view of the specified range within this list.
Throws:
UnsupportedOperationException - because the method is not supported by this list at this time.

indexOf

public int indexOf(Object object)
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
Specified by:
indexOf in interface List
Parameters:
o - element to search for.
Returns:
the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
See Also:
List.indexOf(Object)

lastIndexOf

public int lastIndexOf(Object object)
Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element. More formally, returns the highest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
Specified by:
lastIndexOf in interface List
Parameters:
o - element to search for.
Returns:
the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.

equals

public boolean equals(Object object)
Compares the specified object with this collection for equality.

Specified by:
equals in interface List
Overrides:
equals in class Object
Parameters:
o - Object to be compared for equality with this collection.
Returns:
true if the specified object is equal to this collection
See Also:
Object.equals(Object), Set.equals(Object), List.equals(Object), Collection.equals(Object)

hashCode

public int hashCode()
Specified by:
hashCode in interface List
Overrides:
hashCode in class Object
Returns:
the hash code value for this collection
See Also:
Object.hashCode()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface List
Returns:
TRUE if this collection contains no elements, FALSE otherwise
See Also:
Collection.isEmpty()

size

public int size()
Specified by:
size in interface List
Returns:
the number of elements in this collection
See Also:
Collection.size()

toArray

public Object[] toArray()
Specified by:
toArray in interface List
Returns:
an array representation of the contents of this collection
See Also:
Collection.toArray()

toArray

public Object[] toArray(Object[] p1)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. If the collection fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this collection.

Specified by:
toArray in interface List
Parameters:
a - the array into which the elements of this collection are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
Returns:
an array containing the elements of this collection
Throws:
ArrayStoreException - the runtime type of the specified array is not a supertype of the runtime type of every element in this collection.
NullPointerException - if the specified array is null.
See Also:
Collection.toArray(Object[])

***  This class is subject to change   ***




Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Thu, 16 Feb 2006 01:55:40