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

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.SWSDataHandler
All Implemented Interfaces:
java.io.Serializable

public class SWSDataHandler
extends AbstractCASDataHandler

Class for handling Special Workplace Statistics (SWS) DataRecords.

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
SWSDataHandler()
           
SWSDataHandler(java.io.File a_File)
           
 
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
 AbstractCASDataRecord getDataRecord(long RecordID)
           
 SWSDataRecord getSWSDataRecord(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

SWSDataHandler

public SWSDataHandler()

SWSDataHandler

public SWSDataHandler(java.io.File a_File)
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 CAS001DataRecords and written to this.tRandomAccessFile.

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

getDataRecord

public AbstractCASDataRecord getDataRecord(long RecordID)
Specified by:
getDataRecord in class AbstractCASDataHandler
Parameters:
RecordID - The RecordID of the AbstractCASDataRecord to be returned.
Returns:
An AbstractCASDataRecord for the given RecordID

getSWSDataRecord

public SWSDataRecord getSWSDataRecord(long RecordID)