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

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

public class SWSDataRecord
extends AbstractCASDataRecord

A class for representing a SWS Method of travel to work (2001 SWS Level 3 Table 1) Data Record and providing safe access to the data. There are 36 cells in this table. +-------------------+---------+-------------------------------------------+ | | All | Aged 16-74 in employment | | | persons +-------------------+-----------------------+ | | | Full-time student | Not full-time student | +-------------------+---------+-------------------+-----------------------+ | Total | 1 | 2 | 3 | | Work/study mainly | | | | | at/from home | 4 | 5 | 6 | | Underground etc. | 7 | 8 | 9 | | Train | 10 | 11 | 12 | | Bus etc. | 13 | 14 | 15 | | Taxi | 16 | 17 | 18 | | Car - driver | 19 | 20 | 21 | | Car - passenger | 22 | 23 | 24 | | Motorcycle etc. | 25 | 26 | 27 | | Bicycle | 28 | 29 | 30 | | On foot | 31 | 32 | 33 | | Other | 34 | 35 | 36 | +-------------------+---------+-------------------+-----------------------+

See Also:
Serialized Form

Field Summary
protected  char[] _Destination_Zone_Code
          Destination Zone Code
protected  int _Total
          Total
 
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
SWSDataRecord()
           
SWSDataRecord(boolean initZero)
           
SWSDataRecord(long RecordID, java.lang.String line)
          Creates a new CAS001DataRecord
SWSDataRecord(java.io.RandomAccessFile aRandomAccessFile)
          Creates a new CAS001DataRecord from aRandomAccessFile.
SWSDataRecord(SWSDataRecord a_SWSDataRecord)
           
 
Method Summary
protected  void _Init()
          Initialises all fields.
 java.lang.String get_Destination_Zone_Code()
          Returns a copy of this._Destination_Zone_Code converted to a String
 int get_Total()
          Returns a copy of this._Total
 long getSizeInBytes()
           
protected  void init(SWSDataRecord a_SWSDataRecord)
          Initialises from aCAS001DataRecord.
protected  void initZero()
          Initialises all fields 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

_Destination_Zone_Code

protected char[] _Destination_Zone_Code
Destination Zone Code


_Total

protected int _Total
Total

Constructor Detail

SWSDataRecord

public SWSDataRecord()

SWSDataRecord

public SWSDataRecord(SWSDataRecord a_SWSDataRecord)

SWSDataRecord

public SWSDataRecord(boolean initZero)

SWSDataRecord

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

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

SWSDataRecord

public SWSDataRecord(java.io.RandomAccessFile aRandomAccessFile)
              throws java.io.IOException
Creates a new CAS001DataRecord from aRandomAccessFile. The aRandomAccessFile.getFilePointer() changes only as the CAS001DataRecord is read.

Parameters:
aRandomAccessFile - The RandomAccessFile from which this is created.
Throws:
java.io.IOException
Method Detail

_Init

protected void _Init()
Initialises all fields.

Overrides:
_Init in class AbstractCASDataRecord

initZero

protected void initZero()
Initialises all fields to zero.


init

protected void init(SWSDataRecord a_SWSDataRecord)
Initialises from aCAS001DataRecord.

Parameters:
aCAS001DataRecord - The CAS001DataRecord 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

get_Destination_Zone_Code

public java.lang.String get_Destination_Zone_Code()
Returns a copy of this._Destination_Zone_Code converted to a String


get_Total

public int get_Total()
Returns a copy of this._Total


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

getSizeInBytes

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