com.lizardtech.djvu.outline
Class Bookmark

java.lang.Object
  extended by com.lizardtech.djvu.outline.Bookmark
All Implemented Interfaces:
Codec, DjVuInterface

public class Bookmark
extends java.lang.Object
implements Codec, DjVuInterface

This class decodes outline (bookmarks) contained within a chunk and represents them in a tree structure.

Version:
$Revision: 1.3 $
Author:
$author$

Constructor Summary
Bookmark()
           
 
Method Summary
 void addElement(Bookmark child)
          Add a child bookmark.
static Bookmark createBookmark(DjVuInterface ref)
          Creates an instance of Bookmark with the options interherited from the specified reference.
 void decode(DataPool pool)
          Decodes the directory from the specified datapool.
 Bookmark elementAt(int item)
          Query a child bookmark.
 java.util.Enumeration elements()
          Query the Enumeration of childen.
protected  void flatten()
          Recursively move childrens children as children.
 java.util.Vector getChildren()
          Query the Vector of children bookmarks.
 java.lang.String getDisplayName()
          Query the display name.
 DjVmDir getDjVmDir()
          Query the document directory.
 DjVuOptions getDjVuOptions()
          Query the DjVuOptions used by this object.
 java.lang.Object getObject()
          Query the object associated with this bookmark.
 int getPageno()
          Query the page number linked to this bookmark.
 boolean isImageData()
          Query if this is image data.
 boolean isValid()
          Check if a bookmark is valid.
 void setDisplayName(java.lang.String displayName)
          Set the display name for this bookmark.
 void setDjVmDir(DjVmDir djvmDir)
          Set the document directory.
 void setDjVuOptions(DjVuOptions options)
          Set the DjVuOptions used by this object.
 void setObject(java.lang.Object object)
          Associate an object with this bookmark.
 void setSize(int size)
          Sets the size of this vector.
 void setValid(boolean valid)
          Set whether a bookmark is considered valid.
 int size()
          Query the number of children.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bookmark

public Bookmark()
Method Detail

isImageData

public boolean isImageData()
Query if this is image data.

Specified by:
isImageData in interface Codec
Returns:
false

getChildren

public java.util.Vector getChildren()
Query the Vector of children bookmarks.

Returns:
the Vector of children

setDisplayName

public void setDisplayName(java.lang.String displayName)
Set the display name for this bookmark.

Parameters:
displayName - the name to be displayed for this bookmark

getDisplayName

public java.lang.String getDisplayName()
Query the display name.

Returns:
the display name for this bookmark

setDjVmDir

public void setDjVmDir(DjVmDir djvmDir)
Set the document directory.

Parameters:
djvmDir - the document directory

getDjVmDir

public DjVmDir getDjVmDir()
Query the document directory.

Returns:
the document directory.

setDjVuOptions

public void setDjVuOptions(DjVuOptions options)
Set the DjVuOptions used by this object.

Specified by:
setDjVuOptions in interface DjVuInterface
Parameters:
options - The DjVuOptions used by this object.

getDjVuOptions

public DjVuOptions getDjVuOptions()
Query the DjVuOptions used by this object.

Specified by:
getDjVuOptions in interface DjVuInterface
Returns:
the DjVuOptions used by this object.

setObject

public void setObject(java.lang.Object object)
Associate an object with this bookmark.

Parameters:
object - associated object

getObject

public java.lang.Object getObject()
Query the object associated with this bookmark.

Returns:
the object associated with this bookmark

getPageno

public int getPageno()
Query the page number linked to this bookmark.

Returns:
the page number linked to this bookmark

addElement

public void addElement(Bookmark child)
Add a child bookmark.

Parameters:
child - bookmark to add

createBookmark

public static Bookmark createBookmark(DjVuInterface ref)
Creates an instance of Bookmark with the options interherited from the specified reference.

Parameters:
ref - Object to interherit DjVuOptions from.
Returns:
a new instance of Bookmark.

setSize

public void setSize(int size)
Sets the size of this vector.

Parameters:
size - DOCUMENT ME!

setValid

public void setValid(boolean valid)
Set whether a bookmark is considered valid.

Parameters:
valid - true if valid

isValid

public boolean isValid()
Check if a bookmark is valid.

Returns:
true if valid

decode

public void decode(DataPool pool)
Decodes the directory from the specified datapool.

Specified by:
decode in interface Codec
Parameters:
pool - - the BSInputStream to read from.

elementAt

public Bookmark elementAt(int item)
Query a child bookmark.

Parameters:
item - child number
Returns:
the child bookmark

elements

public java.util.Enumeration elements()
Query the Enumeration of childen.

Returns:
the Enumeration of childen

size

public int size()
Query the number of children.

Returns:
the number of children

flatten

protected void flatten()
Recursively move childrens children as children.