datarecord
Class DataRecordManager
java.lang.Object
datarecord.DataRecordManager
public class DataRecordManager
- extends java.lang.Object
Objects of this class allocate DataRecords. When they're returned,
it caches them for subsequent re-allocation. This class exists to
try to mitigate the overheads of Java on the results.
- Version:
- $Id: DataRecordManager.java,v 1.2 2010/01/05 08:23:09 zahorjan Exp $
Field Summary |
private java.util.HashMap<java.lang.Integer,java.util.LinkedList<DataRecord>> |
freeMap
To try to minimize Java effects, we cache DataRecords (to avoid
creating a lot, which might require garbage collecting a lot). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
freeMap
private java.util.HashMap<java.lang.Integer,java.util.LinkedList<DataRecord>> freeMap
- To try to minimize Java effects, we cache DataRecords (to avoid
creating a lot, which might require garbage collecting a lot).
There is a list per record capacity.
DataRecordManager
public DataRecordManager()
getNewRecord
public DataRecord getNewRecord(int size)
- Class factory -- returns a DataRecord.
freeRecord
public void freeRecord(DataRecord record)
- Called when done using a DataRecord.