krati.core.array.entry
Class PreFillEntry<T extends EntryValue>

java.lang.Object
  extended by krati.core.array.entry.AbstractEntry<T>
      extended by krati.core.array.entry.PreFillEntry<T>
All Implemented Interfaces:
Comparable<Entry<T>>, Entry<T>
Direct Known Subclasses:
PreFillEntryInt, PreFillEntryLong, PreFillEntryShort

public abstract class PreFillEntry<T extends EntryValue>
extends AbstractEntry<T>


Field Summary
protected  int _index
           
protected  ArrayList<T> _valArray
           
 
Fields inherited from class krati.core.array.entry.AbstractEntry
_entryCapacity, _entryId, _maxScn, _minScn, _valFactory
 
Fields inherited from interface krati.core.array.entry.Entry
STORAGE_VERSION
 
Constructor Summary
PreFillEntry(int entryId, EntryValueFactory<T> valFactory, int initialCapacity)
          Create a new entry to hold updates to an array.
 
Method Summary
 void clear()
          Clears this Entry.
protected  void ensureCapacity(int newCapacity)
           
 List<T> getValueList()
           
protected  void loadDataSection(DataReader in, int cnt)
           
protected  void saveDataSection(DataWriter out)
           
 int size()
           
 
Methods inherited from class krati.core.array.entry.AbstractEntry
capacity, compareTo, getFile, getId, getMaxScn, getMinScn, getServiceId, getValueFactory, isEmpty, isFull, load, maintainScn, save, setServiceId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface krati.core.array.entry.Entry
add
 

Field Detail

_index

protected int _index

_valArray

protected final ArrayList<T extends EntryValue> _valArray
Constructor Detail

PreFillEntry

public PreFillEntry(int entryId,
                    EntryValueFactory<T> valFactory,
                    int initialCapacity)
Create a new entry to hold updates to an array.

Parameters:
entryId - The Id of this Entry.
valFactory - The factory for manufacturing EntryValue(s).
initialCapacity - The initial number of values this entry can hold.
Method Detail

size

public final int size()
Returns:
the number of EntryValue(s) in this Entry.

clear

public void clear()
Description copied from interface: Entry
Clears this Entry.

Specified by:
clear in interface Entry<T extends EntryValue>
Overrides:
clear in class AbstractEntry<T extends EntryValue>

getValueList

public List<T> getValueList()
Returns:
a list of EntryValue(s) contained in this Entry.

loadDataSection

protected void loadDataSection(DataReader in,
                               int cnt)
                        throws IOException
Specified by:
loadDataSection in class AbstractEntry<T extends EntryValue>
Throws:
IOException

saveDataSection

protected void saveDataSection(DataWriter out)
                        throws IOException
Specified by:
saveDataSection in class AbstractEntry<T extends EntryValue>
Throws:
IOException

ensureCapacity

protected void ensureCapacity(int newCapacity)


Copyright © 2011. All Rights Reserved.