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

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.projects.moses.utilities.AbstractLog
      extended by uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractDataHandler
          extended by uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractCASDataHandler
              extended by uk.ac.leeds.ccg.andyt.projects.moses.io.CASAreaEastingNorthingDataHandler
All Implemented Interfaces:
java.io.Serializable

public class CASAreaEastingNorthingDataHandler
extends AbstractCASDataHandler

A class for handling an individual CASAreaEastingNorthingDataRecord and collections of CASAreaEastingNorthingDataRecords.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractCASDataHandler
_CAS001DataHandler, _CAS003DataHandler, _LookUpMSOAfromOAHashMap, _RecordIDZoneCodeHashMap
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractDataHandler
_Directory, _File, _RandomAccessFile, _RecordLength
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.moses.utilities.AbstractLog
_Logger, _Logger_FileHandler
 
Constructor Summary
CASAreaEastingNorthingDataHandler()
           
CASAreaEastingNorthingDataHandler(java.io.File a_File)
          Creates a new instance of CASAreaEastingNorthingDataHandler with Records loaded from formattedFile.
 
Method Summary
protected  long format(java.io.File sourceFile, long RecordID)
          Uses a BufferedReader and a StreamTokenizer to read lines from the sourceFile File.
 void formatSourceData(java.io.File directory, int n)
          Loads CAS001DataRecords and prints out n randomly
 java.util.HashMap get_CASZoneCode_CASAreaEastingNorthingDataRecord_HashMap(java.lang.String code)
           
 CASAreaEastingNorthingDataRecord getCASAreaEastingNorthingDataRecord(long RecordID)
           
 AbstractCASDataRecord getDataRecord(long RecordID)
           
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractCASDataHandler
get_LookUpMSOAfromOAHashMap, getCAS001DataHandler, getCAS003DataHandler, getDataRecord, getDataRecord, getLADCodes_TreeSet, getMSOACodes_HashSet, getMSOACodes_HashSet, getOACodes_HashSet, getOACodes_HashSet, getOACodes_TreeSet, getRecordIDZoneCode_HashMap, getRecordIDZoneCodeHashMap, getZoneCodeRecordID_HashMap, parseLine, printOAMSOACodes, write
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractDataHandler
get_Directory, get_RecordLength, getNDataRecords, init, init, load, print
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.moses.utilities.AbstractLog
init_Logger, init_Logger, init_Logger, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CASAreaEastingNorthingDataHandler

public CASAreaEastingNorthingDataHandler()

CASAreaEastingNorthingDataHandler

public CASAreaEastingNorthingDataHandler(java.io.File a_File)
Creates a new instance of CASAreaEastingNorthingDataHandler with Records loaded from formattedFile.

Parameters:
formattedFile - Formatted file of CASAreaEastingNorthingDataRecords
Method Detail

formatSourceData

public void formatSourceData(java.io.File directory,
                             int n)
Loads CAS001DataRecords and prints out n randomly

Parameters:
directory - to load source data from
n - the number of loaded data records to print out.

format

protected long format(java.io.File sourceFile,
                      long RecordID)
Uses a BufferedReader and a StreamTokenizer to read lines from the sourceFile File. The lines are converted to CASAreaEastingNorthingDataRecords and written to this.tRandomAccessFile.

Parameters:
sourceFile - The source CASAreaEastingNorthingDataRecords file to be formatted and written to this.tRandomAccessFile.
RecordID - The RecordID to assign to the first CASAreaEastingNorthingDataRecord.
Returns:
The RecordID assigned to the last CASAreaEastingNorthingDataRecords.

getDataRecord

public AbstractCASDataRecord getDataRecord(long RecordID)
Specified by:
getDataRecord in class AbstractCASDataHandler
Parameters:
RecordID - The RecordID of the CASAreaEastingNorthingDataRecord to be returned.
Returns:
a CASAreaEastingNorthingDataRecord with AbstractCASDataRecord.RecordID = RecordID

getCASAreaEastingNorthingDataRecord

public CASAreaEastingNorthingDataRecord getCASAreaEastingNorthingDataRecord(long RecordID)
Parameters:
RecordID - The RecordID of the CASAreaEastingNorthingDataRecord to be returned.
Returns:
a CASAreaEastingNorthingDataRecord with CASAreaEastingNorthingDataRecord.RecordID = RecordID

get_CASZoneCode_CASAreaEastingNorthingDataRecord_HashMap

public java.util.HashMap get_CASZoneCode_CASAreaEastingNorthingDataRecord_HashMap(java.lang.String code)