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

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `private static class` | `BookSet.GroupFilter` GroupFilter does the SQL traditional group by.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static long` | `serialVersionUID` Serialization ID

    - ### Fields inherited from class java.util.AbstractList

      `modCount`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BookSet()`
    `BookSet(Collection<Book> books)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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<Book> filter)` Get a set of books that satisfy the condition imposed by the 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, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, size, subList, toArray, toArray, trimToSize`

    - ### Methods inherited from class java.util.AbstractList

      `equals, hashCode`

    - ### Methods inherited from class java.util.AbstractCollection

      `containsAll, 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`

- - ### 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` - the property key
      Returns:
        the values for a particular key.

    - #### filter

          public BookSet filter(String key,
                       Object value)

    - #### 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

    - #### 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>`