org.jcon.data
Interface Record

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Implementing Classes:
ArrayListRecord, BeanRecord, FlattenedBean, HashRecord, HashRecordMap, JobInfo, LocationInfo, MiniHeader, StakedUnitInfo

public interface Record
extends java.io.Serializable, java.lang.Cloneable

This is a generic Record, in the relational sense.

Essentially, a Record is defined as an object whose state is entirely mutable through public methods; this makes them easily saved, restored, edited, and cloned.


Method Summary
 java.lang.Object clone()
          Clones the Record.
 java.util.Iterator editableFields()
          A list of PropertyDescriptors describing all the editable (readable and writable) in this Record.
 java.util.Map getAllFieldValues()
          Field values for all readable fields.
 FieldDef getField(java.lang.String fieldName)
          Returns a PropertyDescriptor for the given field.
 java.lang.Object getFieldValue(java.lang.String fieldName)
          Gets the value for a given field.
 java.util.Map getFieldValues()
          Field values for all editable fields.
 java.util.Iterator readableFields()
          A list of PropertyDescriptors describing all the readable fields in this Record.
 void setFieldValue(java.lang.String fieldName, java.lang.Object value)
          Sets the value for a given field.
 void setFieldValues(java.util.Map newFields)
          Sets field values.
 

Method Detail

getField

FieldDef getField(java.lang.String fieldName)
Returns a PropertyDescriptor for the given field.


readableFields

java.util.Iterator readableFields()
A list of PropertyDescriptors describing all the readable fields in this Record.


editableFields

java.util.Iterator editableFields()
A list of PropertyDescriptors describing all the editable (readable and writable) in this Record.


getFieldValue

java.lang.Object getFieldValue(java.lang.String fieldName)
                               throws NoSuchFieldInRecordException
Gets the value for a given field.

Throws:
NoSuchFieldInRecordException

setFieldValue

void setFieldValue(java.lang.String fieldName,
                   java.lang.Object value)
                   throws NoSuchFieldInRecordException,
                          java.lang.IllegalArgumentException
Sets the value for a given field.

Throws:
NoSuchFieldInRecordException
java.lang.IllegalArgumentException

getFieldValues

java.util.Map getFieldValues()
Field values for all editable fields.


getAllFieldValues

java.util.Map getAllFieldValues()
Field values for all readable fields.


setFieldValues

void setFieldValues(java.util.Map newFields)
Sets field values. Unlisted fields are set to null; to leave a field unchanged associate it with a LeaveAloneToken

Invalid fields are ignored.

Parameters:
newFields - A dictionary of fieldnames associated with their values.

clone

java.lang.Object clone()
Clones the Record.