com.azalient.api.file.record
Class AbstractRecordR

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
All Implemented Interfaces:
IRecord, RecordR
Direct Known Subclasses:
AbstractRecordRW

public abstract class AbstractRecordR
extends ReaderUtilities
implements RecordR

An abstract implementation of the RecordRW interface, requiring only the set() method 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
AbstractRecordR()
           
 
Method Summary
 Object[] extraCols()
          Return an array of extra columns for this record.
 void extraSet(Object col, Object data)
          The (API) user can call this to store additional information in any record using "Extra" fields.
 void finished(TableR table)
          The parser calls this when all cells in a row have been read.
 boolean isApplicable(Object col)
          Return false to completely blank out the cell in the editor (value is not shown)
 boolean isEditable(Object col)
          Return false to grey out this field in the editor window (value is still shown)
abstract  void set(Object col, Object data)
          The file reader calls this on a record, when it is read.
 String 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.a.tables.IRecord
name
 

Constructor Detail

AbstractRecordR

public AbstractRecordR()
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
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

isEditable

public boolean isEditable(Object col)
Description copied from interface: RecordR
Return false to grey out this field in the editor window (value is still shown)

Specified by:
isEditable in interface RecordR

isApplicable

public boolean isApplicable(Object col)
Description copied from interface: RecordR
Return false to completely blank out the cell in the editor (value is not shown)

Specified by:
isApplicable in interface RecordR

finished

public void finished(TableR table)
Description copied from interface: RecordR
The parser calls this when all cells in a row have been read. Some records may have many fields and have their fields spread over more than one table. This might also happen if separate tables are used for logical separation of fields of different types. In this case, where the same class is providing the set() functions for multiple tables, that class needs to know which table has been finished, hence the parameter.

Specified by:
finished in interface RecordR

toString

public String toString()
Overrides:
toString in class Object

extraSet

public void extraSet(Object col,
                     Object data)
Description copied from interface: RecordR
The (API) user can call this to 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.

Specified by:
extraSet in interface RecordR
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

extraCols

public Object[] extraCols()
Return an array of extra columns for this record. Returning null or an empty array means there are no extra columns. By default, this returns the list of extra columns stored in the local hash table, but this may be overriden by a subclass that wishes to specify a particular set of extra fields. For example, QLink overrides this with its extra attributes. When a model is saved to AZA, extra attributes for QLinks are saved as extra columns, when this is read in by a system that does not have any QLink objects, the extra columns are preserved, even though they have no meaning.