org.objectweb.medor.eval.cache.lib
Class TupleCache

java.lang.Object
  extended byorg.objectweb.medor.eval.cache.lib.TupleCache
All Implemented Interfaces:
CollectionCache

public class TupleCache
extends java.lang.Object
implements CollectionCache


Constructor Summary
TupleCache(long size)
           
 
Method Summary
 boolean contains(int index)
          Does the cache contains Object ranked int of the associated Objects to be cached.
 void destroy()
          Reinitializes the internal structure of the cache.
 long getCapacity()
           
 Tuple getTuple(int index)
           
 void initialize()
          Creates the internal structure of the cache.
 boolean isCanInsert()
          Are insertions possible (is policy dependent: example may require to free the cache before insertion).
 boolean putTuple(int index, Tuple t)
           
 void setCanInsert(boolean canInsert)
          This method allow stop or no inserting objetcs in the cache.
 void setCapacity(int capacity)
           
 java.util.Iterator tupleIndexIterator()
          Returns an iterator over the indexes of the Objects which are present in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleCache

public TupleCache(long size)
Method Detail

getCapacity

public long getCapacity()
Specified by:
getCapacity in interface CollectionCache

setCapacity

public void setCapacity(int capacity)

getTuple

public Tuple getTuple(int index)
               throws MedorException
Specified by:
getTuple in interface CollectionCache
Parameters:
index - is the rank of the Object
Throws:
MedorException

putTuple

public boolean putTuple(int index,
                        Tuple t)
                 throws MedorException
Specified by:
putTuple in interface CollectionCache
Throws:
MedorException

initialize

public void initialize()
Description copied from interface: CollectionCache
Creates the internal structure of the cache.

Specified by:
initialize in interface CollectionCache

tupleIndexIterator

public java.util.Iterator tupleIndexIterator()
Description copied from interface: CollectionCache
Returns an iterator over the indexes of the Objects which are present in the cache.

Specified by:
tupleIndexIterator in interface CollectionCache

destroy

public void destroy()
Description copied from interface: CollectionCache
Reinitializes the internal structure of the cache.

Specified by:
destroy in interface CollectionCache

contains

public boolean contains(int index)
Description copied from interface: CollectionCache
Does the cache contains Object ranked int of the associated Objects to be cached.

Specified by:
contains in interface CollectionCache

isCanInsert

public boolean isCanInsert()
Description copied from interface: CollectionCache
Are insertions possible (is policy dependent: example may require to free the cache before insertion).

Specified by:
isCanInsert in interface CollectionCache

setCanInsert

public void setCanInsert(boolean canInsert)
Description copied from interface: CollectionCache
This method allow stop or no inserting objetcs in the cache.

Specified by:
setCanInsert in interface CollectionCache