org.apache.lokahi.core.common.collection
Class TMCCache<T extends Collectable>

java.lang.Object
  extended by java.util.AbstractCollection<T>
      extended by org.apache.lokahi.core.common.collection.TMCCache<T>
All Implemented Interfaces:
java.lang.Iterable<T>, java.util.Collection<T>
Direct Known Subclasses:
TMCDataStore

public class TMCCache<T extends Collectable>
extends java.util.AbstractCollection<T>

Version:
$Id: TMCCache.java,v 1.4 2006/03/07 20:18:56 drtobes Exp $
Author:
Stephen Toback

Field Summary
protected  java.util.HashMap<java.lang.Integer,T> cache
           
protected  java.util.HashMap<java.lang.String,java.lang.Integer> index
           
 
Constructor Summary
TMCCache()
           
 
Method Summary
 boolean add(T t)
           
 T get(int i)
           
 T get(java.lang.String i)
           
 java.util.Iterator<T> iterator()
           
 int size()
           
 java.util.Collection<T> values()
           
 
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

index

protected java.util.HashMap<java.lang.String,java.lang.Integer> index

cache

protected java.util.HashMap<java.lang.Integer,T extends Collectable> cache
Constructor Detail

TMCCache

public TMCCache()
Method Detail

add

public boolean add(T t)
Specified by:
add in interface java.util.Collection<T extends Collectable>
Overrides:
add in class java.util.AbstractCollection<T extends Collectable>

get

public T get(int i)

get

public T get(java.lang.String i)

iterator

public java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T extends Collectable>
Specified by:
iterator in interface java.util.Collection<T extends Collectable>
Specified by:
iterator in class java.util.AbstractCollection<T extends Collectable>

size

public int size()
Specified by:
size in interface java.util.Collection<T extends Collectable>
Specified by:
size in class java.util.AbstractCollection<T extends Collectable>

values

public java.util.Collection<T> values()