com.azalient.api.file.record
Class AbstractRecordRW

java.lang.Object
  extended by com.azalient.api.file.record.TypeObject
      extended by com.azalient.api.file.record.ReaderUtilities
          extended by com.azalient.api.file.record.AbstractRecordR
              extended by com.azalient.api.file.record.AbstractRecordRW
All Implemented Interfaces:
IRecord, RecordR, RecordRW, RecordW, SortableData
Direct Known Subclasses:
AbstractStoreRecordFixedName, AbstractStoreRecordIndirectName, AbstractStoreRecordRenamable

public abstract class AbstractRecordRW
extends AbstractRecordR
implements RecordRW

An abstract implementation of the RecordRW interface, requiring only the set() and get() methods to be implemented

For more detail see the RecordR and RecordW interfaces

See Also:
RecordR, RecordW

Field Summary
 
Fields inherited from interface com.azalient.api.a.tables.IRecord
DELETED, KEY_SEP, KEY_SEP_CHAR
 
Constructor Summary
AbstractRecordRW()
           
 
Method Summary
 Object extraGet(Object col)
          The (API) user can store additional information in any record using "Extra" fields.
 boolean extraGetB(Object col)
          Get the data in the named extra column, as a boolean
 double extraGetD(Object col)
          Get the data in the named extra column, as a double
 int extraGetI(Object col)
          Get the data in the named extra column, as an integer
 String extraGetS(Object col)
          Get the data in the named extra column, as a String
 UTime extraGetT(Object col)
          Get the data in the named extra column, as a UTime Object
abstract  Object get(Object col)
          The writer calls this to get the data in the record.
 boolean isVolatile()
          If true, do not save the record
abstract  void set(Object col, Object data)
          The file reader calls this on a record, when it is read.
 
Methods inherited from class com.azalient.api.file.record.AbstractRecordR
extraCols, extraSet, finished, isApplicable, isEditable, toString
 
Methods inherited from class com.azalient.api.file.record.TypeObject
b, c, d, equals, equals, equalsEW, f, i, keyString, keyString, nameFromKeyString, rowKeysFromKeyString, s, t, t
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.azalient.api.file.RecordR
extraSet, finished, isApplicable, isEditable
 
Methods inherited from interface com.azalient.api.a.tables.IRecord
name
 
Methods inherited from interface com.azalient.api.file.RecordW
extraCols
 

Constructor Detail

AbstractRecordRW

public AbstractRecordRW()
Method Detail

set

public abstract void set(Object col,
                         Object data)
Description copied from interface: RecordR
The file reader calls this on a record, when it is read.

If the field is a multiple type (by convention the column name ends with '*') then this may be called several times
After the last cell in a row has been read, then the reader calls RecordR.finished(TableR table)

Specified by:
set in interface RecordR
Specified by:
set in class AbstractRecordR
Parameters:
col - The key (name) of the field (column in the table), normally of type String
data - an object having one of the following types:
  • String
  • Double
  • Integer
  • Boolean
  • UTime

get

public abstract Object get(Object col)
Description copied from interface: RecordW
The writer calls this to get the data in the record.

Specified by:
get in interface RecordW
Specified by:
get in interface SortableData
Parameters:
col - The column header key (normally a String)
Returns:
an object having one of the following types:
  • String
  • Double / Float
  • Integer / Long
  • Boolean
  • UTime

OR

an object of any other type - converted to a String using the toString() method

OR

the data may be an array of uniform type. An array of objects is expected if the key-string ends in "*". (This is a convention, not enforced).

isVolatile

public boolean isVolatile()
Description copied from interface: RecordW
If true, do not save the record

Specified by:
isVolatile in interface RecordW

extraGet

public Object extraGet(Object col)
Description copied from interface: RecordW
The (API) user can store additional information in any record using "Extra" fields. There is no limit to the number of Extra fields, the only constraint is that the field name must be unique. Normally, the columnName passed in is a String, but any other type of object can be used. This method returns the data as one of the types described in the get method()

Specified by:
extraGet in interface RecordW
See Also:
RecordW.get(Object), RecordR.extraSet(Object, Object)

extraGetD

public double extraGetD(Object col)
Description copied from interface: RecordW
Get the data in the named extra column, as a double

Specified by:
extraGetD in interface RecordW
See Also:
RecordW.extraGet(Object)

extraGetB

public boolean extraGetB(Object col)
Description copied from interface: RecordW
Get the data in the named extra column, as a boolean

Specified by:
extraGetB in interface RecordW
See Also:
RecordW.extraGet(Object)

extraGetI

public int extraGetI(Object col)
Description copied from interface: RecordW
Get the data in the named extra column, as an integer

Specified by:
extraGetI in interface RecordW
See Also:
RecordW.extraGet(Object)

extraGetS

public String extraGetS(Object col)
Description copied from interface: RecordW
Get the data in the named extra column, as a String

Specified by:
extraGetS in interface RecordW
See Also:
RecordW.extraGet(Object)

extraGetT

public UTime extraGetT(Object col)
Description copied from interface: RecordW
Get the data in the named extra column, as a UTime Object

Specified by:
extraGetT in interface RecordW
See Also:
RecordW.extraGet(Object)