things.data
Interface ThingsPropertyTrunk

All Known Implementing Classes:
ThingsPropertyTrunkInMemory, ThingsPropertyTrunkIO

public interface ThingsPropertyTrunk

A two way channel for getting or putting properties. Useful for load and save.

Version:
1.0

Version History

EPG - Initial - 18 NOV 02
 
Author:
Erich P. Gatejen

Nested Class Summary
static class ThingsPropertyTrunk.Mode
          The mode for this trunk.
 
Method Summary
 void endRead()
          End a read transfer.
 void endWrite()
          End a wrote transfer.
 ThingsPropertyTrunk.Mode getMode()
          Get the current Mode.
 void init(java.lang.String id, Accessor accessItem)
          Sets the ID.
 NV readNext()
          Read the next property.
 void startRead()
          Start a read.
 void startWrite()
          Start a write transfer.
 void writeNext(NVImmutable item)
          Write the next property
 void writeNext(java.lang.String name, java.lang.String value)
          Write the next property
 void writeNextMultivalue(java.lang.String name, java.lang.String... values)
          Write the next property that is a multivalue.
 

Method Detail

getMode

ThingsPropertyTrunk.Mode getMode()
Get the current Mode.

Returns:
the Mode.

init

void init(java.lang.String id,
          Accessor accessItem)
          throws ThingsException
Sets the ID. It's really up to the implementation as to what the ID means. It may be ignored and all will be transfered.

Parameters:
id - An id
accessItem - A way to read and write the data.
Throws:
ThingsException

startRead

void startRead()
               throws ThingsException
Start a read.

Throws:
ThingsException

endRead

void endRead()
             throws ThingsException
End a read transfer. If a read hasn't started, nothing bad will happen.

Throws:
ThingsException

startWrite

void startWrite()
                throws ThingsException
Start a write transfer.

Throws:
ThingsException

endWrite

void endWrite()
              throws ThingsException
End a wrote transfer. If a write hasn't started, nothing bad will happen. It should flush and close the destination.

Throws:
ThingsException

writeNext

void writeNext(java.lang.String name,
               java.lang.String value)
               throws ThingsException
Write the next property

Parameters:
name - The property name as a string
value - The property value as a string
Throws:
ThingsException

writeNext

void writeNext(NVImmutable item)
               throws ThingsException
Write the next property

Parameters:
item - the next property as an NVImmutable.
Throws:
ThingsException
See Also:
NVImmutable

writeNextMultivalue

void writeNextMultivalue(java.lang.String name,
                         java.lang.String... values)
                         throws ThingsException
Write the next property that is a multivalue.

Parameters:
name - The property name as a string
values - The property values
Throws:
ThingsException

readNext

NV readNext()
            throws ThingsException
Read the next property. Returns null when there is nothing left to read.

Returns:
NV or null when done.
Throws:
ThingsException


Things.