|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Generic document.
The term document is used in its most generic sense, and can be any
object that can be meaningfully interpreted as the result of a search (see the
DocumentSearcherI
interface), and which possesses an input or
output data stream.
A document is an object representing information about a piece of data, much like a directory entry represents information for files in a file system. By itself, a document entry does not contain any data contents, but serves as a "pointer" or "proxy" object representing the actual document object, from which the contents of the document can be accessed. It also contains information about the actual document, such as its length and the date it was last modified.
Some of the methods of this interface were modelled after the
File
and ZipFile
classes.
DocumentSearcherI
,
WritableDocumentI
Field Summary | |
static java.lang.String |
REV
Revision information. |
static int |
SERIES
Series number. |
Method Summary | |
boolean |
canRead()
Determine if the contents of this document are readable. |
boolean |
canWrite()
Determine if the contents of this document are writable. |
boolean |
exists()
Determine if the actual contents of this document exist. |
java.lang.Object |
getAttribute(java.lang.String attr)
Retrieve the value of an attribute for this document. |
java.lang.String[] |
getAttributeNames()
Retrieve the attribute names for this document. |
java.io.InputStream |
getInputStream()
Get a readable input stream for this document. |
java.lang.String |
getName()
Retrieve the name for this document. |
java.lang.String |
getType()
Retrieve the type of this document. |
boolean |
isDirectory()
Determine if this document specifies a directory entry. |
java.util.Date |
lastModified()
Determine the date that this document was last modified. |
long |
length()
Determine the length of the contents of this document. |
void |
setAttribute(java.lang.String attr,
java.lang.Object val)
Set the value of an attribute for this document. |
Field Detail |
public static final java.lang.String REV
public static final int SERIES
Method Detail |
public boolean exists() throws java.lang.Exception
java.lang.Exception
- Thrown if the information about the document is unobtainable, or if some
other error occurs.public boolean isDirectory() throws java.lang.Exception
java.lang.Exception
- Thrown if the information about the document is unobtainable, or if some
other error occurs.public boolean canRead() throws java.lang.Exception
java.lang.Exception
- Thrown if the information about the document is unobtainable, or if some
other error occurs.getInputStream()
,
canWrite()
public boolean canWrite() throws java.lang.Exception
java.lang.Exception
- Thrown if the information about the document is unobtainable, or if some
other error occurs.getInputStream()
,
canRead()
public long length() throws java.lang.Exception
java.lang.Exception
- Thrown if the information about the document is unobtainable, or if some
other error occurs.public java.util.Date lastModified() throws java.lang.Exception
java.lang.Exception
- Thrown if the document cannot be accessed, or if some other error occurs.public java.lang.String getName() throws java.lang.Exception
java.lang.Exception
- Thrown if the information about the document is unobtainable, or if some
other error occurs.public java.lang.String getType() throws java.lang.Exception
java.lang.Exception
- Thrown if the information about the document is unobtainable, or if some
other error occurs.public java.lang.String[] getAttributeNames() throws java.lang.Exception
The attributes associated with a given document, if any, are specific to the particular implementation of this interface. If the implementation does not support any attributes for its document class type, this method returns null.
java.lang.Exception
- Thrown if the information about the document is unobtainable, or if some
other error occurs.getAttribute(java.lang.String)
,
setAttribute(java.lang.String, java.lang.Object)
public java.lang.Object getAttribute(java.lang.String attr) throws java.lang.Exception
attr
- The name of an attribute associated with this document.
java.lang.Exception
- Thrown if the information about the document is unobtainable, or if some
other error occurs.getAttributeNames()
public void setAttribute(java.lang.String attr, java.lang.Object val) throws java.lang.Exception, java.lang.UnsupportedOperationException
attr
- The name of an attribute associated with this document.val
- The new value of the specified attribute.
java.lang.Exception
- Thrown if the information about the document cannot be set, or if some
other error occurs.
java.lang.UnsupportedOperationException
- (unchecked)
Thrown if this method is not implemented for this document type.getAttributeNames()
public java.io.InputStream getInputStream() throws java.lang.Exception, java.lang.UnsupportedOperationException
java.lang.Exception
- Thrown if the input stream cannot be obtained, or if some other error
occurs.
java.lang.UnsupportedOperationException
- (unchecked)
Thrown if the stream cannot be read from (i.e., is write only), or if this
method is not supported for this document type.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |