org.crosswire.jsword.book.basic
Class DefaultBookmark

java.lang.Object
  extended by org.crosswire.jsword.book.basic.DefaultBookmark
All Implemented Interfaces:
Serializable, Cloneable, Bookmark

public class DefaultBookmark
extends Object
implements Bookmark

A Bookmark remembers a particular view of one or more Books. What is viewed regarding a book set is either a SearchRequest or a key lookup request.

Author:
DM Smith
See Also:
for license details.
The copyright to this program is held by it's authors.
, Serialized Form

Field Summary
private  List<Book> books
          The list of books.
private  String lookupRequest
          The lookup request.
private  SearchRequest searchRequest
          The search request.
private static long serialVersionUID
          Serialization ID
 
Constructor Summary
DefaultBookmark()
          Create an empty default bookmark
 
Method Summary
 void addBook(Book book)
          Add a Book to this Bookmark.
 DefaultBookmark clone()
          This needs to be declared here so that it is visible as a method on a derived Bookmark.
 BookData getBookData()
          Convert this Bookmark into a BookData by converting the SearchReqeust or lookup request into a key list.
 List<Book> getBooks()
          Return the ordered set of books.
 String getLookupRequest()
          Get the lookup request.
 SearchRequest getSearchRequest()
          Get the SearchRequest for this Bookmark.
 void setLookupRequest(String request)
          Set the lookup request for this Bookmark.
 void setSearchRequest(SearchRequest request)
          Set the SearchRequest for this Bookmark.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

books

private transient List<Book> books
The list of books.


lookupRequest

private String lookupRequest
The lookup request.


searchRequest

private SearchRequest searchRequest
The search request.


serialVersionUID

private static final long serialVersionUID
Serialization ID

See Also:
Constant Field Values
Constructor Detail

DefaultBookmark

public DefaultBookmark()
Create an empty default bookmark

Method Detail

addBook

public void addBook(Book book)
Description copied from interface: Bookmark
Add a Book to this Bookmark. The books are maintained in the order they are added as a set.

Specified by:
addBook in interface Bookmark
Parameters:
book - the Book to add.

getBooks

public List<Book> getBooks()
Description copied from interface: Bookmark
Return the ordered set of books.

Specified by:
getBooks in interface Bookmark
Returns:
the books

setSearchRequest

public void setSearchRequest(SearchRequest request)
Description copied from interface: Bookmark
Set the SearchRequest for this Bookmark. A copy of the SearchRequest will be stored. Note, setting this will clear the lookup request, if any.

Specified by:
setSearchRequest in interface Bookmark
Parameters:
request - the SearchRequest

getSearchRequest

public SearchRequest getSearchRequest()
Description copied from interface: Bookmark
Get the SearchRequest for this Bookmark.

Specified by:
getSearchRequest in interface Bookmark
Returns:
a copy of the SearchRequest, or null.

setLookupRequest

public void setLookupRequest(String request)
Description copied from interface: Bookmark
Set the lookup request for this Bookmark. Note, setting this will clear the SearchRequest, if any.

Specified by:
setLookupRequest in interface Bookmark
Parameters:
request - the lookup request.

getLookupRequest

public String getLookupRequest()
Description copied from interface: Bookmark
Get the lookup request.

Specified by:
getLookupRequest in interface Bookmark
Returns:
the lookup request or null.

getBookData

public BookData getBookData()
Description copied from interface: Bookmark
Convert this Bookmark into a BookData by converting the SearchReqeust or lookup request into a key list.

Specified by:
getBookData in interface Bookmark
Returns:
the resulting BookData

clone

public DefaultBookmark clone()
Description copied from interface: Bookmark
This needs to be declared here so that it is visible as a method on a derived Bookmark.

Specified by:
clone in interface Bookmark
Overrides:
clone in class Object
Returns:
A complete copy of ourselves

Copyright ? 2003-2011