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

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

public class ISARDataHandler
extends AbstractDataHandler

For accessing ISARDataRecords and information about them.

See Also:
Serialized Form

Nested Class Summary
 class ISARDataHandler.AgeSexType
          A simple class for distinguishing ISARDataRecords into those with the same of Age, Sex and Type characteristics where Type can be either: RELTOHR = 1 for HRP RELTOHR = -9 for Communal Establishment Populations RELTOHR = other for general household person
 
Field Summary
protected  java.util.HashMap _AgeSexType_ISARDataRecordVector_HashMap_0
           
protected  java.util.HashMap _AgeSexType_ISARDataRecordVector_HashMap_1
           
protected  ISARDataRecord[] _ISARDataRecordArray
          For storing ISARDataRecords.
 
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
ISARDataHandler()
          Creates a new instance of ISARDataHandler
ISARDataHandler(java.io.File aFile)
          Creates a new instance of ISARDataHandler from aFile.
 
Method Summary
 void formatSource(java.io.File sourceFile, java.io.File formattedFile)
          Loads from source file
 java.util.HashMap get_AgeSexType_ISARDataRecordVector_HashMap_0()
           
 java.util.HashMap<ISARDataHandler.AgeSexType,java.util.Vector> get_AgeSexType_ISARDataRecordVector_HashMap_0(ISARDataRecord[] a_ISARDataRecord_Array)
           
 java.util.HashMap get_ID_RecordID_HashMap()
          Method to be used to look up ISARDataRecord from ISARDataRecord._ID.
 int getAgeSexTypeCount_0(ISARDataHandler.AgeSexType aAgeSexType)
          a return integer count of the number of other ISARDataRecords in _ISARDataRecordArray with the same AgeSexType(aISARDataRecord)
 int getAgeSexTypeCount_0(ISARDataRecord aISARDataRecord)
          a return integer count of the number of other ISARDataRecords in _ISARDataRecordArray with the same AgeSexType(aISARDataRecord)
 AbstractDataRecord getDataRecord(long RecordID)
           
 ISARDataRecord getISARDataRecord(long RecordID)
           
 ISARDataRecord getISARDataRecord(java.util.Random aRandom, ISARDataHandler.AgeSexType aAgeSexType)
           
 ISARDataRecord getISARDataRecord(java.util.Random aRandom, ISARDataRecord aISARDataRecord)
           
 long getNDataRecords()
           
static short getRELTOHRType1(ISARDataRecord aISARDataRecord)
           
protected  void init_AgeSexType_ISARDataRecordVector_HashMap_0()
          Initialises _AgeSexType_ISARDataRecordArray_HashMap by going through _ISARDataRecordArray.
 void loadIntoCache()
          Loads ISARDataRecords into the cache.
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.moses.io.AbstractDataHandler
get_Directory, get_RecordLength, 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
 

Field Detail

_ISARDataRecordArray

protected ISARDataRecord[] _ISARDataRecordArray
For storing ISARDataRecords.


_AgeSexType_ISARDataRecordVector_HashMap_0

protected java.util.HashMap _AgeSexType_ISARDataRecordVector_HashMap_0

_AgeSexType_ISARDataRecordVector_HashMap_1

protected java.util.HashMap _AgeSexType_ISARDataRecordVector_HashMap_1
Constructor Detail

ISARDataHandler

public ISARDataHandler()
Creates a new instance of ISARDataHandler


ISARDataHandler

public ISARDataHandler(java.io.File aFile)
Creates a new instance of ISARDataHandler from aFile.

Parameters:
aFile -
Method Detail

loadIntoCache

public void loadIntoCache()
Loads ISARDataRecords into the cache.


formatSource

public void formatSource(java.io.File sourceFile,
                         java.io.File formattedFile)
                  throws java.io.IOException
Loads from source file

Throws:
java.io.IOException

getDataRecord

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

getISARDataRecord

public ISARDataRecord getISARDataRecord(long RecordID)
Parameters:
RecordID - The RecordID of the ISARDataRecord to be returned.

get_AgeSexType_ISARDataRecordVector_HashMap_0

public java.util.HashMap get_AgeSexType_ISARDataRecordVector_HashMap_0()
Returns:
_AgeSexType_ISARDataRecordArray_HashMap first initialising it if it is null.

init_AgeSexType_ISARDataRecordVector_HashMap_0

protected void init_AgeSexType_ISARDataRecordVector_HashMap_0()
Initialises _AgeSexType_ISARDataRecordArray_HashMap by going through _ISARDataRecordArray.


get_ID_RecordID_HashMap

public java.util.HashMap get_ID_RecordID_HashMap()
Method to be used to look up ISARDataRecord from ISARDataRecord._ID.

Returns:
a HashMap for looking up RecordID from ID

getNDataRecords

public long getNDataRecords()
Overrides:
getNDataRecords in class AbstractDataHandler
Returns:
The number of AbstractDataRecords in this.tRandomAccessFile

get_AgeSexType_ISARDataRecordVector_HashMap_0

public java.util.HashMap<ISARDataHandler.AgeSexType,java.util.Vector> get_AgeSexType_ISARDataRecordVector_HashMap_0(ISARDataRecord[] a_ISARDataRecord_Array)
Parameters:
-
Returns:
HashMap

getAgeSexTypeCount_0

public int getAgeSexTypeCount_0(ISARDataRecord aISARDataRecord)
a return integer count of the number of other ISARDataRecords in _ISARDataRecordArray with the same AgeSexType(aISARDataRecord)


getAgeSexTypeCount_0

public int getAgeSexTypeCount_0(ISARDataHandler.AgeSexType aAgeSexType)
a return integer count of the number of other ISARDataRecords in _ISARDataRecordArray with the same AgeSexType(aISARDataRecord)


getISARDataRecord

public ISARDataRecord getISARDataRecord(java.util.Random aRandom,
                                        ISARDataRecord aISARDataRecord)
Parameters:
aISARDataRecord -
aRandom -
Returns:
ISARDataRecord with the same AgeSexType as aISARDataRecord or null if there is no such ISARDataRecord

getISARDataRecord

public ISARDataRecord getISARDataRecord(java.util.Random aRandom,
                                        ISARDataHandler.AgeSexType aAgeSexType)
Returns:
ISARDataRecord with the same AgeSexType as aISARDataRecord or null if there is no such ISARDataRecord

getRELTOHRType1

public static short getRELTOHRType1(ISARDataRecord aISARDataRecord)