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

java.lang.Object
  extended by krati.core.array.entry.AbstractEntry<T>
      extended by krati.core.array.entry.SimpleEntry<T>
All Implemented Interfaces:
Comparable<Entry<T>>, Entry<T>

public class SimpleEntry<T extends EntryValue>
extends AbstractEntry<T>

EntryImpl. Transactional Redo Entry.

Author:
jwu

Field Summary
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
SimpleEntry(int entryId, EntryValueFactory<T> valFactory, int initialCapacity)
          Create a new entry to hold updates to an array.
 
Method Summary
 void add(T value)
          Adds an EntryValue.
 void clear()
          Clears this Entry.
 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
 

Field Detail

_valArray

protected final ArrayList<T extends EntryValue> _valArray
Constructor Detail

SimpleEntry

public SimpleEntry(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 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>

add

public void add(T value)
Description copied from interface: Entry
Adds an 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


Copyright © 2011. All Rights Reserved.