org.crosswire.common.util
Class SortedListSet

java.lang.Object
  extended by java.util.AbstractCollection
      extended by java.util.AbstractList
          extended by java.util.ArrayList
              extended by org.crosswire.common.util.SortedListSet
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess, Set
Direct Known Subclasses:
BookSet

public class SortedListSet
extends ArrayList
implements Set

Maintains a sorted list of unique objects. It is expected that the objects implement Comparable. Methods that take an index to indicate an insertion point are ignored.

Author:
DM Smith [dmsmith555 at yahoo dot com]
See Also:
for license details. The copyright to this program is held by it's authors., Serialized Form

Field Summary
private static long serialVersionUID
          Serialization ID
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SortedListSet()
          Create an empty SortedListSet of default size.
SortedListSet(Collection c)
           
SortedListSet(int initialCapacity)
          Create an empty SortedListSet of the stated capacity
 
Method Summary
 void add(int index, Object element)
           
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 boolean addAll(int index, Collection c)
           
 SortedListSet filter(Filter filter)
          Get a filtered list set.
 Object set(int index, Object element)
           
 
Methods inherited from class java.util.ArrayList
clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serialization ID

See Also:
Constant Field Values
Constructor Detail

SortedListSet

public SortedListSet()
Create an empty SortedListSet of default size.


SortedListSet

public SortedListSet(int initialCapacity)
Create an empty SortedListSet of the stated capacity

Parameters:
initialCapacity -

SortedListSet

public SortedListSet(Collection c)
Parameters:
c -
Method Detail

add

public void add(int index,
                Object element)
Specified by:
add in interface List
Overrides:
add in class ArrayList

add

public boolean add(Object o)
Specified by:
add in interface Collection
Specified by:
add in interface List
Specified by:
add in interface Set
Overrides:
add in class ArrayList

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List
Specified by:
addAll in interface Set
Overrides:
addAll in class ArrayList

addAll

public boolean addAll(int index,
                      Collection c)
Specified by:
addAll in interface List
Overrides:
addAll in class ArrayList

set

public Object set(int index,
                  Object element)
Specified by:
set in interface List
Overrides:
set in class ArrayList

filter

public SortedListSet filter(Filter filter)
Get a filtered list set.

Parameters:
filter - The criteria by which to filter.
Returns:
a filtered SortedListSet.

Copyright ยจ 2003-2005