org.crosswire.jsword.book
Class BookSet
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<Book>
org.crosswire.jsword.book.BookSet
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<Book>, Collection<Book>, List<Book>, RandomAccess, Set<Book>
public class BookSet
- extends ArrayList<Book>
- implements Set<Book>
BookSet represents a collection of descriptions about Books which may be
subsetted into other BookMetaDataSets. Each set is naturally ordered.
- Author:
- DM Smith
- See Also:
The GNU Lesser General Public License for details.
,
Serialized Form
Nested Class Summary |
private static class |
BookSet.GroupFilter
GroupFilter does the SQL traditional group by. |
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
BookSet
public BookSet()
BookSet
public BookSet(Collection<Book> books)
getGroups
public Set<String> getGroups()
- Gets the sorted set of all keys which can be used for groupings. These
are all the property keys across the BookMetaDatas in this list.
- Returns:
- the set of all keys which can be used for grouping.
getGroup
public Set<Object> getGroup(String key)
- Get the sorted set of all values for a particular key. If there is a
BookMetaData that does not have a value for that key, then null will be
in the set. This can be use to categorize books that don't have that key.
For example, "Language" will return all the languages for this
BookMetaDataList and null for which the language is unknown.
- Parameters:
key
- the property key
- Returns:
- the values for a particular key.
filter
public BookSet filter(String key,
Object value)
add
public void add(int index,
Book element)
- Specified by:
add
in interface List<Book>
- Overrides:
add
in class ArrayList<Book>
add
public final boolean add(Book book)
- Specified by:
add
in interface Collection<Book>
- Specified by:
add
in interface List<Book>
- Specified by:
add
in interface Set<Book>
- Overrides:
add
in class ArrayList<Book>
addAll
public final boolean addAll(Collection<? extends Book> c)
- Specified by:
addAll
in interface Collection<Book>
- Specified by:
addAll
in interface List<Book>
- Specified by:
addAll
in interface Set<Book>
- Overrides:
addAll
in class ArrayList<Book>
addAll
public final boolean addAll(int index,
Collection<? extends Book> c)
- Specified by:
addAll
in interface List<Book>
- Overrides:
addAll
in class ArrayList<Book>
set
public Book set(int index,
Book element)
- Specified by:
set
in interface List<Book>
- Overrides:
set
in class ArrayList<Book>
filter
public BookSet filter(Filter<Book> filter)
- Get a set of books that satisfy the condition imposed by the filter.
- Parameters:
filter
- the condition on which to select books
- Returns:
- the set of matching books