|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tribble.archive.AbstractDocument tribble.archive.AbstractWritableDocument
public abstract class AbstractWritableDocument
Generic read-only archive document.
An archive document is composed of content data (such as an image, text, or other kind of user data) and one or more properties.
Most of the methods in this base class that implement the
ArchiveDocument
interface do not throw any checked exceptions.
Note: This requires Java 1.5 or later.
Field Summary |
---|
Fields inherited from class tribble.archive.AbstractDocument |
---|
m_id, m_props, m_propVals, m_size |
Constructor Summary | |
---|---|
protected |
AbstractWritableDocument(DocumentProperty[] props)
Constructor. |
Method Summary | |
---|---|
void |
addProperty(WritableProperty prop)
Add a property to this archive document. |
void |
setID(java.lang.String id)
Establish the ID of this archive document. |
void |
setProperty(java.lang.String prop,
java.lang.Object val)
Set the value of a property in this archive document. |
void |
setSize(long len)
Establish the data size for this archive document. |
Methods inherited from class tribble.archive.AbstractDocument |
---|
checkOpen, close, finalize, getID, getProperties, getProperty, getSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface tribble.archive.WritableDocument |
---|
putDataStream |
Methods inherited from interface tribble.archive.ArchiveDocument |
---|
close, getDataStream, getID, getProperties, getProperty, getSize |
Constructor Detail |
---|
protected AbstractWritableDocument(DocumentProperty[] props)
props
- The properties which define the documents in the archive.Method Detail |
---|
public void setID(java.lang.String id) throws java.io.IOException, java.lang.UnsupportedOperationException
setID
in interface WritableDocument
id
- A name that identifies the document within the archive.
Whether or not this name is unique is up to the implementation.
java.io.IOException
- Thrown if an error occurred while accessing the document.
java.lang.UnsupportedOperationException
- (unchecked)
Thrown if this operation is not allowed by the implementation, i.e.,
if IDs are assigned to archive documents by some other means.
java.lang.IllegalStateException
- (unchecked)
Thrown if AbstractDocument.close()
has been called for this object.public void setSize(long len)
setSize
in interface WritableDocument
len
- The size (typically in bytes) of the document data, or -1 if the size is
not known.
java.lang.IllegalStateException
- (unchecked)
Thrown if AbstractDocument.close()
has been called for this object.public void setProperty(java.lang.String prop, java.lang.Object val) throws java.io.IOException
setProperty
in interface WritableDocument
prop
- The name of the document property to set.val
- The new property value.
java.io.IOException
- Thrown if an error occurred while modifying the document.
java.lang.IllegalStateException
- (unchecked)
Thrown if AbstractDocument.close()
has been called for this object.public void addProperty(WritableProperty prop) throws java.lang.UnsupportedOperationException, java.io.IOException
addProperty
in interface WritableDocument
prop
- A property to add to this document.
java.io.IOException
- Thrown if the property already exists in this document, or if an error
occurred while modifying the document.
java.lang.UnsupportedOperationException
- (unchecked)
Thrown if this method is not supported by the implementation of this
interface.
java.lang.IllegalStateException
- (unchecked)
Thrown if AbstractDocument.close()
has been called for this object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |