org.crosswire.common.util
Class SortedListSet
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.ArrayList
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.
Distribution Licence:
JSword is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License,
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
The License is available on the internet
here, or by writing to:
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA
The copyright to this program is held by it's authors.
|
- Version:
- $Id: SortedListSet.java,v 1.2 2005/03/06 20:21:59 dmsmith Exp $
- Author:
- DM Smith [dmsmith555 at yahoo dot com]
- See Also:
Licence
,
Serialized Form
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 interface java.util.Set |
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
serialVersionUID
private static final long serialVersionUID
- Serialization ID
- See Also:
- Constant Field Values
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
-
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.