org.crosswire.jsword.book
Class BookSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<Book>
              extended by 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:
for license details.
The copyright to this program is held by it's authors.
, Serialized Form

Nested Class Summary
private static class BookSet.GroupFilter
          GroupFilter does the SQL traditional group by.
 
Field Summary
private static long serialVersionUID
          Serialization ID
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
BookSet()
           
BookSet(Collection<Book> books)
           
 
Method Summary
 boolean add(Book book)
           
 void add(int index, Book element)
           
 boolean addAll(Collection<? extends Book> c)
           
 boolean addAll(int index, Collection<? extends Book> c)
           
 BookSet filter(Filter filter)
           
 BookSet filter(String key, Object value)
           
 Set<Object> getGroup(String key)
          Get the sorted set of all values for a particular key.
 Set<String> getGroups()
          Gets the sorted set of all keys which can be used for groupings.
 Book set(int index, Book 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

BookSet

public BookSet()

BookSet

public BookSet(Collection<Book> books)
Method Detail

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 -
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 filter)

Copyright ? 2003-2011