|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tribble.archive.AbstractDocument
public abstract class AbstractDocument
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 class do not throw any checked exceptions.
Note: This requires Java 1.5 or later.
AbstractWritableDocument
Field Summary | |
---|---|
protected java.lang.String |
m_id
Document ID. |
protected DocumentProperty[] |
m_props
Properties. |
protected java.lang.Object[] |
m_propVals
Property values. |
protected long |
m_size
Document size (typically in bytes). |
Constructor Summary | |
---|---|
protected |
AbstractDocument(DocumentProperty[] props)
Constructor. |
Method Summary | |
---|---|
protected void |
checkOpen()
Check that this archive document has not been closed. |
void |
close()
Close this archive document. |
protected void |
finalize()
Finalization. |
java.lang.String |
getID()
Retrieve the ID of this archive document. |
DocumentProperty[] |
getProperties()
Retrieve the properties for this archive document. |
java.lang.Object |
getProperty(java.lang.String prop)
Retrieve the value of a property in this archive document. |
long |
getSize()
Retrieve the size of the data for this archive document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface tribble.archive.ArchiveDocument |
---|
getDataStream |
Field Detail |
---|
protected java.lang.String m_id
protected long m_size
protected DocumentProperty[] m_props
protected java.lang.Object[] m_propVals
Constructor Detail |
---|
protected AbstractDocument(DocumentProperty[] props)
props
- The properties which define the documents in the archive.
This can be null.Method Detail |
---|
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected void checkOpen() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- (unchecked)
Thrown if close()
has been called for this object.public void close()
Note that this method can be called multiple times with no ill effects.
Note that this method does not throw any exceptions.
close
in interface java.io.Closeable
close
in interface ArchiveDocument
public java.lang.String getID()
getID
in interface ArchiveDocument
java.io.IOException
- Thrown if an error occurred while accessing the document.public long getSize()
getSize
in interface ArchiveDocument
java.lang.IllegalStateException
- (unchecked)
Thrown if close()
has been called for this object.public DocumentProperty[] getProperties()
getProperties
in interface ArchiveDocument
java.lang.IllegalStateException
- (unchecked)
Thrown if close()
has been called for this object.public java.lang.Object getProperty(java.lang.String prop) throws java.io.IOException
getProperty
in interface ArchiveDocument
prop
- The name of the document property value to retrieve.
java.io.IOException
- Thrown if the document does not have the specified property.
java.lang.IllegalStateException
- (unchecked)
Thrown if close()
has been called for this object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |