uk.ac.leeds.ccg.andyt.projects.moses.io
Class CASUV003DataRecord

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractDataRecord
      extended by uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractCASDataRecord
          extended by uk.ac.leeds.ccg.andyt.projects.moses.io.CASUV003DataRecord
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class CASUV003DataRecord
extends AbstractCASDataRecord

For representing CAS UV003 Records and providing safe access to the data.

See Also:
Serialized Form

Field Summary
protected  int allPeople
          KS0050001 = allPersons (allPeople)
protected  int females
          KS0050003 = females
protected  int males
          KS0050002 = males
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractCASDataRecord
Zone_Code
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractDataRecord
_RecordID
 
Constructor Summary
CASUV003DataRecord()
          Creates a new CASUV003Record
CASUV003DataRecord(CASUV003DataRecord aCASUV003Record)
          Creates a new CASUV003Record cloned from aCASUV003Record
CASUV003DataRecord(long RecordID, java.lang.String line)
          Creates a new CASUV003DataRecord
CASUV003DataRecord(java.io.RandomAccessFile aRandomAccessFile)
          Creates a new CASUV003Record
 
Method Summary
protected  void _Init()
          Initialise.
 CASUV003DataRecord aggregate(CASUV003DataRecord aCASUV003DataRecord)
           
 CASUV003DataRecord aggregate(CASUV003DataRecord aCASUV003DataRecord, long newRecordID, char[] newZone_Code)
           
 int getAllPeople()
          Returns a copy of this.allPeople
 int getFemales()
          Returns a copy of this.females
 int getMales()
          Returns a copy of this.males
 long getSizeInBytes()
          Returns the size of this Record in bytes as a long.
protected  void init(CASUV003DataRecord aCASUV003Record)
          Initialises all fields from those in aCASUV003Record.
 java.lang.String toCSVString()
           
 java.lang.String toCSVStringFields()
           
 java.lang.String toString()
          Returns a string description of this;
 void write(java.io.RandomAccessFile aRandomAccessFile)
          Writes this to aRandomAccessFile at the current position.
 void write(java.io.RandomAccessFile aRandomAccessFile, boolean avoidCallToSuper)
          Writes this to aRandomAccessFile at the current position.
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractCASDataRecord
equals, getZone_Code, hashCode, init, write
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractDataRecord
_Init, compareTo, get_RecordID, getNumberOfBitsInByte
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

allPeople

protected int allPeople
KS0050001 = allPersons (allPeople)


males

protected int males
KS0050002 = males


females

protected int females
KS0050003 = females

Constructor Detail

CASUV003DataRecord

public CASUV003DataRecord()
Creates a new CASUV003Record


CASUV003DataRecord

public CASUV003DataRecord(CASUV003DataRecord aCASUV003Record)
Creates a new CASUV003Record cloned from aCASUV003Record

Parameters:
aCASUV003Record - The CASUV003Record from which this is cloned.

CASUV003DataRecord

public CASUV003DataRecord(long RecordID,
                          java.lang.String line)
                   throws java.io.IOException
Creates a new CASUV003DataRecord

Parameters:
RecordID - The RecordID to be assigned to this
line - The Comma Seperated Value String
Throws:
java.io.IOException

CASUV003DataRecord

public CASUV003DataRecord(java.io.RandomAccessFile aRandomAccessFile)
Creates a new CASUV003Record

Parameters:
aRandomAccessFile -
Method Detail

_Init

protected void _Init()
Initialise.

Overrides:
_Init in class AbstractCASDataRecord

init

protected void init(CASUV003DataRecord aCASUV003Record)
Initialises all fields from those in aCASUV003Record.

Parameters:
aCASUV003Record - The CASUV003DataRecord thats fields are used to initialise this.

toString

public java.lang.String toString()
Returns a string description of this;

Overrides:
toString in class AbstractCASDataRecord
Returns:
A String description of this.

toCSVString

public java.lang.String toCSVString()
Overrides:
toCSVString in class AbstractCASDataRecord
Returns:
A Comma Seperated Version (CSV) String of the values of the Fields of this.

toCSVStringFields

public java.lang.String toCSVStringFields()
Overrides:
toCSVStringFields in class AbstractCASDataRecord
Returns:
A Comma Seperated Version (CSV) String of the names of the Fields of this

getAllPeople

public int getAllPeople()
Returns a copy of this.allPeople


getMales

public int getMales()
Returns a copy of this.males


getFemales

public int getFemales()
Returns a copy of this.females


write

public void write(java.io.RandomAccessFile aRandomAccessFile)
Writes this to aRandomAccessFile at the current position.

Overrides:
write in class AbstractCASDataRecord
Parameters:
aRandomAccessFile - The RandomAccessFile this is written to.
See Also:
AbstractDataRecord.write(RandomAccessFile)

write

public void write(java.io.RandomAccessFile aRandomAccessFile,
                  boolean avoidCallToSuper)
Writes this to aRandomAccessFile at the current position.

Parameters:
aRandomAccessFile - The RandomAccessFile this is written to.
avoidCallToSuper - If true super.write() is not called

aggregate

public CASUV003DataRecord aggregate(CASUV003DataRecord aCASUV003DataRecord)
Parameters:
aCASUV003DataRecord - The CASUV003DataRecord to be aggregated with this.
Returns:
An aggregated CASUV003DataRecord where: RecordID = this.RecordID Zone_Code = this.Zone_Code For aggregating CASUV003DataRecords. User needs to take care in aggregating to ensure aggregation does not compromise (introduce error) based on the numbers used (i.e. numbers may not be precise or have sufficient magnitude).

aggregate

public CASUV003DataRecord aggregate(CASUV003DataRecord aCASUV003DataRecord,
                                    long newRecordID,
                                    char[] newZone_Code)
Parameters:
aCASUV003DataRecord - The CASUV003DataRecord to be aggregated with this.
newRecordID - The RecordID assigned to result.
newZone_Code - The Zone_Code assigned to result.
Returns:
An aggregated CASUV003DataRecord where: RecordID = newRecordID Zone_Code = newZone_Code For aggregating CASUV003DataRecords. User needs to take care in aggregating to ensure aggregation does not compromise (introduce error) based on the numbers used (i.e. numbers may not be precise or have sufficient magnitude).

getSizeInBytes

public long getSizeInBytes()
Returns the size of this Record in bytes as a long. This does not account for serialVersionUID. A boolean is assumed to be the same size as an int in bytes.

Overrides:
getSizeInBytes in class AbstractCASDataRecord
Returns:
The size (in bytes) of this as a long. This does not account for the private Fields serialVersionUID.