dbXML API

com.dbxml.db.core
Interface Container


public interface Container

Container is a generic container for objects that are stored in a collection. A container can either contain a DocumentTable or a Value, depending on the collection type. Container associates the internal document or binary representation with its original collection and key, so that the contents of the container can be stored without having to maintain three separate references.


Field Summary
static int TYPE_DOCUMENT
           
static int TYPE_VALUE
           
 
Method Summary
 java.lang.String getCanonicalName()
          getCanonicalName returns the canonical name for the contained Object.
 Collection getCollection()
          getCollection returns the Collection that the Object contained belongs to.
 int getContainerType()
          getContainerType returns the type of Object being contained by this Container.
 DocumentTable getDocument()
          getDocument returns the contained Document.
 Key getKey()
          getKey returns the Object Key.
 Value getValue()
          getValue returns the contained Value (if any).
 void remove()
          remove removes the Object from the Collection.
 void reset()
          reset reloads the Object from the Collection.
 void setDocument(DocumentTable document)
          setDocument replaces the Document in the Collection with the specified Document.
 void setValue(Value value)
          setValue replaces the Value in the Collection with the specified Value.
 

Field Detail

TYPE_DOCUMENT

public static final int TYPE_DOCUMENT
See Also:
Constant Field Values

TYPE_VALUE

public static final int TYPE_VALUE
See Also:
Constant Field Values
Method Detail

getContainerType

public int getContainerType()
getContainerType returns the type of Object being contained by this Container. This value can either TYPE_DOCUMENT or TYPE_VALUE.

Returns:
The Object type

getCollection

public Collection getCollection()
getCollection returns the Collection that the Object contained belongs to.

Returns:
The owner Collection

getKey

public Key getKey()
getKey returns the Object Key.

Returns:
The Object Key

getCanonicalName

public java.lang.String getCanonicalName()
                                  throws DBException
getCanonicalName returns the canonical name for the contained Object.
ex: /local/test/ocs/ytd

Returns:
The canonical name
Throws:
DBException - If a Database Exception occurs

getDocument

public DocumentTable getDocument()
                          throws DBException
getDocument returns the contained Document.

Returns:
The Document
Throws:
DBException - if a DocumentTable is not contained

getValue

public Value getValue()
               throws DBException
getValue returns the contained Value (if any).

Returns:
The Value
Throws:
DBException - if a Value is not contained

reset

public void reset()
           throws DBException
reset reloads the Object from the Collection.

Throws:
DBException - If a Database Exception occurs

remove

public void remove()
            throws DBException
remove removes the Object from the Collection.

Throws:
DBException - If a Database Exception occurs

setDocument

public void setDocument(DocumentTable document)
                 throws DBException
setDocument replaces the Document in the Collection with the specified Document.

Parameters:
document - The Document
Throws:
DBException - if Collection doesn't store Documents

setValue

public void setValue(Value value)
              throws DBException
setValue replaces the Value in the Collection with the specified Value.

Parameters:
value - The Value
Throws:
DBException - if Collection doesn't store Values

dbXML API

Copyright (c) 2004 The dbXML Group