net.sourceforge.jpalm.mobiledb.record
Class FieldDefinitionsRecord

java.lang.Object
  extended by net.sourceforge.jpalm.DataBlock
      extended by net.sourceforge.jpalm.mobiledb.record.AbstractRecord
          extended by net.sourceforge.jpalm.mobiledb.record.FieldDefinitionsRecord
All Implemented Interfaces:
Record

public class FieldDefinitionsRecord
extends AbstractRecord

The field definitions record in a MobileDB database.

There should be exactly one of these records in a MobileDB database and should always have 20 fields.

When this class is serialized, if the field count is not 20, fields will be added or removed until the count is 20. If fields need to be added, they will be TextDefinition fields.


Field Summary
static net.sourceforge.juint.UInt8 CATEGORY_ID
          The category identifier for this record.
 
Fields inherited from class net.sourceforge.jpalm.mobiledb.record.AbstractRecord
fields, header, HEADER, MAX_FIELD_WIDTH, TERIMINATOR, TRAILER
 
Constructor Summary
FieldDefinitionsRecord()
          Creates a new field definitions record.
FieldDefinitionsRecord(byte[] data)
          Creates a new field definitions record from a byte array.
FieldDefinitionsRecord(java.util.List<Definition> fieldDefinitions)
          Creates a new field definitions record from the specified field definitions.
FieldDefinitionsRecord(Record record)
          Creates a new field definitions record from a Record.
 
Method Summary
 java.util.List<Definition> getFieldDefinitions()
          Gets the field definitions.
 byte[] serialize()
          Create a byte array of the class properties.
 void setFieldDefinitions(java.util.List<Definition> fields)
          Sets the field definitions.
 
Methods inherited from class net.sourceforge.jpalm.mobiledb.record.AbstractRecord
deserialize, equals, getHeader, getInternalFields, setHeader, setInternalFields, trimOrFillList
 
Methods inherited from class net.sourceforge.jpalm.DataBlock
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CATEGORY_ID

public static final net.sourceforge.juint.UInt8 CATEGORY_ID
The category identifier for this record.

Constructor Detail

FieldDefinitionsRecord

public FieldDefinitionsRecord()
Creates a new field definitions record.


FieldDefinitionsRecord

public FieldDefinitionsRecord(byte[] data)
Creates a new field definitions record from a byte array.

Parameters:
data - the byte array
See Also:
AbstractRecord.deserialize(byte[])

FieldDefinitionsRecord

public FieldDefinitionsRecord(Record record)
Creates a new field definitions record from a Record.

Parameters:
record - the record

FieldDefinitionsRecord

public FieldDefinitionsRecord(java.util.List<Definition> fieldDefinitions)
Creates a new field definitions record from the specified field definitions.

Parameters:
fieldDefinitions - the field definitions
See Also:
setFieldDefinitions(List)
Method Detail

getFieldDefinitions

public java.util.List<Definition> getFieldDefinitions()
Gets the field definitions.

Returns:
the field definitions

setFieldDefinitions

public void setFieldDefinitions(java.util.List<Definition> fields)
Sets the field definitions.

Parameters:
fields - the definitions

serialize

public byte[] serialize()
Description copied from class: DataBlock
Create a byte array of the class properties.

Specified by:
serialize in interface Record
Overrides:
serialize in class AbstractRecord
Returns:
the byte array