|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tribble.repository.AbstractDocument
public abstract class AbstractDocument
Generic read-only repository document.
A repository document is composed of content data (such as an image, text, or other kind of user data) and zero or more properties.
Most of the methods in this class do not throw any checked exceptions.
Note: This requires Java 1.5 or later.
AbstractStorableDocument
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 repository document has not been closed. |
void |
close()
Close this repository document. |
protected void |
finalize()
Finalization. |
java.lang.String |
getID()
Retrieve the ID of this repository document. |
DocumentProperty[] |
getProperties()
Retrieve the properties for this repository document. |
java.lang.Object |
getProperty(java.lang.String prop)
Retrieve the value of a property in this repository document. |
long |
getSize()
Retrieve the size of the data for this repository document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface tribble.repository.Document |
---|
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 repository.
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 Document
public java.lang.String getID()
getID
in interface Document
java.io.IOException
- Thrown if an error occurred while accessing the document.public long getSize()
getSize
in interface Document
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 Document
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.public DocumentProperty[] getProperties()
getProperties
in interface Document
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 |