org.jcon.data
Class HashRecord

java.lang.Object
  extended by org.jcon.data.HashRecord
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Record

public abstract class HashRecord
extends java.lang.Object
implements Record

This was a Record whose values were maintained in an internal HashMap (but now are maintained in a Naming so they're case-insensitive).

Version:
1.0 10/10/97
Author:
Paul Reavis
See Also:
Serialized Form

Constructor Summary
HashRecord()
           
 
Method Summary
 java.lang.Object clone()
          Clones the Record.
 Naming convertToNaming()
          Converts this HashRecord object to a more modern (and simpler) Naming structure.
 java.util.Iterator editableFields()
          A list of FieldDefs describing all the editable (readable and writable) in this Record.
protected abstract  java.util.Map editableFieldsDict()
           
 java.util.Map getAllFieldValues()
          Field values for all editable fields.
 FieldDef getField(java.lang.String fieldName)
          Returns a FieldDef 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 readable fields.
 java.util.Iterator readableFields()
          A list of FieldDefs describing all the readable fields in this Record.
protected abstract  java.util.Map readableFieldsDict()
           
 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.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashRecord

public HashRecord()
Method Detail

getField

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

Specified by:
getField in interface Record

readableFields

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

Specified by:
readableFields in interface Record

editableFields

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

Specified by:
editableFields in interface Record

getFieldValue

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

Specified by:
getFieldValue in interface Record
Throws:
NoSuchFieldInRecordException

setFieldValue

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

Specified by:
setFieldValue in interface Record
Throws:
NoSuchFieldInRecordException
java.lang.IllegalArgumentException

getFieldValues

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

Specified by:
getFieldValues in interface Record

getAllFieldValues

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

Specified by:
getAllFieldValues in interface Record

setFieldValues

public 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.

Specified by:
setFieldValues in interface Record
Parameters:
newFields - A dictionary of fieldnames associated with their values.

clone

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

Specified by:
clone in interface Record
Overrides:
clone in class java.lang.Object

convertToNaming

public Naming convertToNaming()
Converts this HashRecord object to a more modern (and simpler) Naming structure.


readableFieldsDict

protected abstract java.util.Map readableFieldsDict()

editableFieldsDict

protected abstract java.util.Map editableFieldsDict()