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

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.CASKS017DataRecord
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class CASKS017DataRecord
extends AbstractCASDataRecord

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

See Also:
Serialized Form

Field Summary
protected  int allCarsOrVansInTheArea
          KS0170007 = allCarsOrVansInTheArea
protected  int allHouseholds
          KS0170001 = allHouseholds
protected  int householdsWith0CarsOrVans
          KS0170002 = householdsWith0CarsOrVans
protected  int householdsWith1CarOrVan
          KS0170003 = householdsWith1CarOrVan
protected  int householdsWith2CarsOrVans
          KS0170004 = householdsWith2CarsOrVans
protected  int householdsWith3CarsOrVans
          KS0170005 = householdsWith3CarsOrVans
protected  int householdsWith4OrMoreCarsOrVans
          KS0170006 = householdsWith4OrMoreCarsOrVans
 
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
CASKS017DataRecord()
          Creates a new CASKS017Record
CASKS017DataRecord(CASKS017DataRecord aCASKS017Record)
          Creates a new CASKS017Record cloned from aCASKS017Record
CASKS017DataRecord(long RecordID, java.lang.String line)
          Creates a new CASKS017DataRecord
CASKS017DataRecord(java.io.RandomAccessFile aRandomAccessFile)
          Creates a new CASKS017Record
 
Method Summary
protected  void _Init()
          Initialise.
 CASKS017DataRecord aggregate(CASKS017DataRecord aCASKS017DataRecord)
           
 CASKS017DataRecord aggregate(CASKS017DataRecord aCASKS017DataRecord, long newRecordID, char[] newZone_Code)
           
 int getAllCarsOrVansInTheArea()
          Returns a copy of this.allCarsOrVansInTheArea
 int getAllHouseholds()
          Returns a copy of this.allHouseholds
 int getHouseholdsWith0CarsOrVans()
          Returns a copy of this.householdsWith0CarsOrVans
 int getHouseholdsWith1CarOrVan()
          Returns a copy of this.householdsWith1CarOrVan
 int getHouseholdsWith2CarsOrVans()
          Returns a copy of this.householdsWith2CarsOrVans
 int getHouseholdsWith3CarsOrVans()
          Returns a copy of this.householdsWith3CarsOrVans
 int getHouseholdsWith4OrMoreCarsOrVans()
          Returns a copy of this.householdsWith4OrMoreCarsOrVans
 long getSizeInBytes()
          Returns the size of this Record in bytes as a long.
protected  void init(CASKS017DataRecord cASKS017Record)
          Initialises all fields from those in cASKS017Record.
protected  void initZero()
          Initialise to zero.
 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

allHouseholds

protected int allHouseholds
KS0170001 = allHouseholds


householdsWith0CarsOrVans

protected int householdsWith0CarsOrVans
KS0170002 = householdsWith0CarsOrVans


householdsWith1CarOrVan

protected int householdsWith1CarOrVan
KS0170003 = householdsWith1CarOrVan


householdsWith2CarsOrVans

protected int householdsWith2CarsOrVans
KS0170004 = householdsWith2CarsOrVans


householdsWith3CarsOrVans

protected int householdsWith3CarsOrVans
KS0170005 = householdsWith3CarsOrVans


householdsWith4OrMoreCarsOrVans

protected int householdsWith4OrMoreCarsOrVans
KS0170006 = householdsWith4OrMoreCarsOrVans


allCarsOrVansInTheArea

protected int allCarsOrVansInTheArea
KS0170007 = allCarsOrVansInTheArea

Constructor Detail

CASKS017DataRecord

public CASKS017DataRecord()
Creates a new CASKS017Record


CASKS017DataRecord

public CASKS017DataRecord(CASKS017DataRecord aCASKS017Record)
Creates a new CASKS017Record cloned from aCASKS017Record

Parameters:
aCASKS017Record - The CASKS017Record from which this is cloned.

CASKS017DataRecord

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

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

CASKS017DataRecord

public CASKS017DataRecord(java.io.RandomAccessFile aRandomAccessFile)
                   throws java.io.IOException
Creates a new CASKS017Record

Parameters:
aRandomAccessFile -
Throws:
java.io.IOException
Method Detail

_Init

protected void _Init()
Initialise.

Overrides:
_Init in class AbstractCASDataRecord

initZero

protected void initZero()
Initialise to zero.


init

protected void init(CASKS017DataRecord cASKS017Record)
Initialises all fields from those in cASKS017Record.

Parameters:
cASKS017Record - The CASKS017Record 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

getAllHouseholds

public int getAllHouseholds()
Returns a copy of this.allHouseholds


getHouseholdsWith0CarsOrVans

public int getHouseholdsWith0CarsOrVans()
Returns a copy of this.householdsWith0CarsOrVans


getHouseholdsWith1CarOrVan

public int getHouseholdsWith1CarOrVan()
Returns a copy of this.householdsWith1CarOrVan


getHouseholdsWith2CarsOrVans

public int getHouseholdsWith2CarsOrVans()
Returns a copy of this.householdsWith2CarsOrVans


getHouseholdsWith3CarsOrVans

public int getHouseholdsWith3CarsOrVans()
Returns a copy of this.householdsWith3CarsOrVans


getHouseholdsWith4OrMoreCarsOrVans

public int getHouseholdsWith4OrMoreCarsOrVans()
Returns a copy of this.householdsWith4OrMoreCarsOrVans


getAllCarsOrVansInTheArea

public int getAllCarsOrVansInTheArea()
Returns a copy of this.allCarsOrVansInTheArea


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 CASKS017DataRecord aggregate(CASKS017DataRecord aCASKS017DataRecord)
Parameters:
aCASKS017DataRecord - The CASKS017DataRecord to be aggregated with this.
Returns:
An aggregated CASKS017DataRecord where: RecordID = this.RecordID Zone_Code = this.Zone_Code For aggregating CASKS017DataRecords. 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 CASKS017DataRecord aggregate(CASKS017DataRecord aCASKS017DataRecord,
                                    long newRecordID,
                                    char[] newZone_Code)
Parameters:
aCASKS017DataRecord - The CASKS017DataRecord to be aggregated with this.
newRecordID - The RecordID assigned to result.
newZone_Code - The Zone_Code assigned to result.
Returns:
An aggregated CASKS017DataRecord where: RecordID = newRecordID Zone_Code = newZone_Code For aggregating CASKS017DataRecords. 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.