uk.ac.leeds.ccg.andyt.projects.moses.io
Class CAS001DataHandler
java.lang.Object
uk.ac.leeds.ccg.andyt.projects.moses.utilities.AbstractLog
uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractDataHandler
uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractCASDataHandler
uk.ac.leeds.ccg.andyt.projects.moses.io.CAS001DataHandler
- All Implemented Interfaces:
- java.io.Serializable
public class CAS001DataHandler
- extends AbstractCASDataHandler
Class for handling an individual CAS001DataRecords.
- See Also:
- Serialized Form
Constructor Summary |
CAS001DataHandler()
Creates a new instance of CAS001DataHandler loading a default file. |
CAS001DataHandler(java.io.File aFile)
Creates a new instance of CAS001DataHandler with Records loaded from
aFile. |
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractCASDataHandler |
get_LookUpMSOAfromOAHashMap, getCAS001DataHandler, getCAS003DataHandler, getDataRecord, getDataRecord, getLADCodes_TreeMap, getOACodes_TreeMap, getRecordIDZoneCodeHashMap, parseLine, printOAMSOACodes, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CAS001DataHandler
public CAS001DataHandler()
- Creates a new instance of CAS001DataHandler loading a default file.
CAS001DataHandler
public CAS001DataHandler(java.io.File aFile)
- Creates a new instance of CAS001DataHandler with Records loaded from
aFile.
- Parameters:
aFile
- Formatted file of CAS001DataRecords.
formatSourceData
protected void formatSourceData(java.io.File directory,
int n)
- Loads
CAS001DataRecords
and prints out n randomly
- Parameters:
directory
- to load source data fromn
- 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 CAS001DataRecord to be returned.
- Returns:
- a
CAS001DataRecord
with
AbstractCASDataRecord.RecordID = RecordID
getCAS001DataRecord
public CAS001DataRecord getCAS001DataRecord(long RecordID)
- Parameters:
RecordID
- The RecordID of the CAS001DataRecord to be returned.
- Returns:
- a
CAS001DataRecord
with
CAS001DataRecord.RecordID = RecordID
aggregateOAToWard
public void aggregateOAToWard(java.io.RandomAccessFile aRandomAccessFile,
long startRecordID,
long endRecordID)
- Aggregates
CAS001DataRecords
from OA To Ward for the OA
records in the range [startRecordID,endRecordID] and writes the results
to aRandomAccessFile
- Parameters:
aRandomAccessFile
- RandomAccessFile
to which results are writtenstartRecordID
- The first OA RecordID in the sequence to be aggregated.endRecordID
- The last OA RecordID in the sequence to be aggregated.
aggregateOAToMSOA
public void aggregateOAToMSOA(java.io.RandomAccessFile aRandomAccessFile,
long startRecordID,
long endRecordID)
- Aggregates
CAS001DataRecords
from OA To MSOA for the OA
records in the range [startRecordID,endRecordID] and writes the results
to aRandomAccessFile
- Parameters:
aRandomAccessFile
- RandomAccessFile
to which results are writtenstartRecordID
- The first OA RecordID in the sequence to be aggregated.endRecordID
- The last OA RecordID in the sequence to be aggregated.
getCAS001HPAgeCount1_HashMap
public java.util.HashMap getCAS001HPAgeCount1_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0,5,8,10,15,16,20,25,30,45,60,65,70,75,80,85,90;
values are counts of the Communal Establishment Population
getCAS001HPAgeFemaleCount1_HashMap
public java.util.HashMap getCAS001HPAgeFemaleCount1_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0,5,8,10,15,16,20,25,30,45,60,65,70,75,80,85,90;
values are counts of the Communal Establishment Population
getCAS001HPAgeMaleCount1_HashMap
public java.util.HashMap getCAS001HPAgeMaleCount1_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0,5,8,10,15,16,20,25,30,45,60,65,70,75,80,85,90;
values are counts of the Communal Establishment Population
getCAS001HPAgeCount3_HashMap
public java.util.HashMap getCAS001HPAgeCount3_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0-15,16,20,25,30,45,60,65,70,75,80,85,90;
values are counts of the Communal Establishment Population
getCAS001HPAgeMaleCount3_HashMap
public java.util.HashMap getCAS001HPAgeMaleCount3_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0-15,16,20,25,30,45,60,65,70,75,80,85,90;
values are counts of the Communal Establishment Population
getCAS001HPAgeFemaleCount3_HashMap
public java.util.HashMap getCAS001HPAgeFemaleCount3_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0-15,16,20,25,30,45,60,65,70,75,80,85,90;
values are counts of the Communal Establishment Population
getCAS001CEPAgeCount1_HashMap
public java.util.HashMap getCAS001CEPAgeCount1_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0,5,8,10,15,16,20,25,30,45,60,65,70,75,80,85,90;
values are counts of the Communal Establishment Population
getCAS001CEPAgeCount2_HashMap
public java.util.HashMap getCAS001CEPAgeCount2_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0,16,20,25,30,45,60,65,70,75;
values are counts of the Communal Establishment Population
getCAS001CEPAgeFemaleCount3_HashMap
public java.util.HashMap getCAS001CEPAgeFemaleCount3_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0-15,16,20,25,30,45,60,65,70,75,80,85,90;
values are counts of the Communal Establishment Population
getCAS001CEPAgeMaleCount3_HashMap
public java.util.HashMap getCAS001CEPAgeMaleCount3_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0-15,16,20,25,30,45,60,65,70,75,80,85,90;
values are counts of the Communal Establishment Population
getCAS001CEPAgeCount3_HashMap
public java.util.HashMap getCAS001CEPAgeCount3_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0-15,16,20,25,30,45,60,65,70,75,80,85,90;
values are counts of the Communal Establishment Population
getCAS001CEPAgeFemaleCount4_HashMap
public java.util.HashMap getCAS001CEPAgeFemaleCount4_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0,16,20,25,30,45,60,65,70,75,80,85,90;
values are counts of the Communal Establishment Population
getCAS001CEPAgeMaleCount4_HashMap
public java.util.HashMap getCAS001CEPAgeMaleCount4_HashMap(CAS001DataRecord tCAS001DataRecord)
- Returns:
- A HashMap with keys representing age categories:
0,16,20,25,30,45,60,65,70,75,80,85,90;
values are counts of the Communal Establishment Population