|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lizardtech.djvu.DjVuObject
com.lizardtech.djvu.Document
public class Document
This class represents indirect, bundled, and single page DjVu documents.
Field Summary | |
---|---|
protected java.util.Hashtable |
dataPoolMap
A map of saved pages for this document. |
static byte[] |
octets
These are the magic numbers at the start of every DjVu file. |
protected java.util.Hashtable |
pageMap
A Vector of soft links to decoded pages. |
Fields inherited from class com.lizardtech.djvu.DjVuObject |
---|
hasReferences |
Constructor Summary | |
---|---|
Document()
Creates a new Document object. |
|
Document(java.net.URL url)
Creates a new Document object. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a listener for property change events. |
java.lang.Object |
clone()
Create a copy by value. |
DjVuPage |
createDjVuPage(java.net.URL url)
Create an overloaded DjVuPage object |
static Document |
createDocument(DjVuInterface ref)
Creates an instance of Document with the options interherited from the specified reference. |
void |
delete_file(java.lang.String id)
Remove the named file from the index |
DataPool |
get_data(int page_num)
Query the data for a page. |
DataPool |
get_data(java.lang.String id)
Query the data for the specified name. |
Codec |
getBookmark()
Query the bookmark codec for this document |
DjVmDir |
getDjVmDir()
Query the index for this document. |
DjVuPage |
getPage(int pageno,
int priority,
boolean dataWait)
Get the respective page and start decoding. |
DjVuPage |
getPage(java.lang.String id,
int priority,
boolean dataWait)
Get the respective page and start decoding. |
int |
getPageno(java.lang.String url)
Convert a relative url to a page number. |
java.lang.String |
getStatus()
Query the status string. |
Document |
init(java.net.URL url)
Initialize this document from the specified URL. |
void |
insert_file(DataPool pool,
int file_type,
java.lang.String name,
java.lang.String id)
Add a file to the index. |
void |
insert_file(DataPool pool,
int file_type,
java.lang.String name,
java.lang.String id,
java.lang.String title)
Add a file to the index. |
void |
insert_file(DataPool pool,
int file_type,
java.lang.String name,
java.lang.String id,
java.lang.String title,
int pos)
Add a file to the index. |
void |
insert_file(DjVmDir.File f,
DataPool data_pool)
Insert a file. |
void |
insert_file(DjVmDir.File f,
DataPool data_pool,
int pos)
Insert a file. |
void |
insert_file(java.io.InputStream input,
int file_type,
java.lang.String name,
java.lang.String id)
Add a file to the index. |
void |
insert_file(java.io.InputStream input,
int file_type,
java.lang.String name,
java.lang.String id,
java.lang.String title)
Add a file to the index. |
void |
insert_file(java.io.InputStream input,
int file_type,
java.lang.String name,
java.lang.String id,
java.lang.String title,
int pos)
Add a file to the index. |
boolean |
isAsync()
Query if the asynchronous flag is set. |
void |
prefetch()
Call to prefetch all the data for this document. |
void |
read(DataPool data_pool)
Called to initialize from the specified stream. |
void |
read(java.io.InputStream input)
Called to initialize from the specified stream. |
void |
read(java.net.URL url)
Called to initialize from the specified stream. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a listener for PropertyChangeEvent. |
void |
run()
This run method is called by the thread created with prefetch() |
void |
setAsync(boolean value)
Set the flag to allow or disallow asynchronous operations. |
void |
setStatus(java.lang.String status)
Set the status string and fire a property change event "status". |
int |
size()
Query the number of pages. |
Methods inherited from class com.lizardtech.djvu.DjVuObject |
---|
checkLockTime, create, create, createSoftReference, createWeakReference, getDjVuOptions, getFromReference, invoke, setDjVuOptions |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte[] octets
protected java.util.Hashtable dataPoolMap
protected java.util.Hashtable pageMap
Constructor Detail |
---|
public Document()
public Document(java.net.URL url) throws java.io.IOException
url
- DOCUMENT ME!
java.io.IOException
- DOCUMENT ME!Method Detail |
---|
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- to addpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- to removepublic void setStatus(java.lang.String status)
status
- new status stringpublic java.lang.String getStatus()
public static Document createDocument(DjVuInterface ref)
ref
- Object to interherit DjVuOptions from.
public final void setAsync(boolean value)
value
- true if asynchronous operations should be used.public final boolean isAsync()
public Codec getBookmark()
public DjVmDir getDjVmDir()
public DjVuPage getPage(int pageno, int priority, boolean dataWait) throws java.io.IOException
pageno
- page number to getpriority
- decode prioritydataWait
- True if bundled pages should be opened even when the
data is not ready.
java.io.IOException
- if an error occurspublic DjVuPage getPage(java.lang.String id, int priority, boolean dataWait) throws java.io.IOException
id
- the page namepriority
- decode prioritydataWait
- True if bundled pages should be opened even when the
data is not ready.
java.io.IOException
- if an error occurspublic int getPageno(java.lang.String url)
url
- the relative url
public java.lang.Object clone()
clone
in class java.lang.Object
public DjVuPage createDjVuPage(java.net.URL url)
public void delete_file(java.lang.String id) throws java.io.IOException
id
- name to remove
java.io.IOException
- if an error occurspublic DataPool get_data(java.lang.String id) throws java.io.IOException
id
- name of the file
java.io.IOException
- if an error occurspublic DataPool get_data(int page_num) throws java.io.IOException
page_num
- the page number to request
java.io.IOException
- if an error occurspublic Document init(java.net.URL url) throws java.io.IOException
url
- the url to initialize from
java.io.IOException
- if an error occurspublic void insert_file(java.io.InputStream input, int file_type, java.lang.String name, java.lang.String id) throws java.io.IOException
input
- data to addfile_type
- type of file to addname
- saved nameid
- load name
java.io.IOException
- if an error occurspublic void insert_file(java.io.InputStream input, int file_type, java.lang.String name, java.lang.String id, java.lang.String title) throws java.io.IOException
input
- data to addfile_type
- type of file to addname
- saved nameid
- load nametitle
- file title
java.io.IOException
- if an error occurspublic void insert_file(java.io.InputStream input, int file_type, java.lang.String name, java.lang.String id, java.lang.String title, int pos) throws java.io.IOException
input
- data to addfile_type
- type of file to addname
- saved nameid
- load nametitle
- file titlepos
- position to insert
java.io.IOException
- if an error occurspublic void insert_file(DataPool pool, int file_type, java.lang.String name, java.lang.String id) throws java.io.IOException
pool
- data to addfile_type
- type of file to addname
- saved nameid
- load name
java.io.IOException
- if an error occurspublic void insert_file(DataPool pool, int file_type, java.lang.String name, java.lang.String id, java.lang.String title) throws java.io.IOException
pool
- data to addfile_type
- type of file to addname
- saved nameid
- load nametitle
- file title
java.io.IOException
- if an error occurspublic void insert_file(DataPool pool, int file_type, java.lang.String name, java.lang.String id, java.lang.String title, int pos) throws java.io.IOException
pool
- data to addfile_type
- type of file to addname
- saved nameid
- load nametitle
- file titlepos
- position to insert
java.io.IOException
- if an error occurspublic void insert_file(DjVmDir.File f, DataPool data_pool) throws java.io.IOException
f
- File to adddata_pool
- data to add
java.io.IOException
- DOCUMENT ME!public void insert_file(DjVmDir.File f, DataPool data_pool, int pos) throws java.io.IOException
f
- File to adddata_pool
- data to addpos
- position to insert
java.io.IOException
- DOCUMENT ME!public void prefetch()
public void read(java.io.InputStream input) throws java.io.IOException
input
- stream to read
java.io.IOException
- if an error occurspublic void read(DataPool data_pool) throws java.io.IOException
data_pool
- data to read
java.io.IOException
- if an error occurspublic void read(java.net.URL url) throws java.io.IOException
url
- URL to read
java.io.IOException
- if an error occurspublic void run()
run
in interface java.lang.Runnable
public int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |