org.jrabbit.base.data.structures
Class OrderedKeyedContainer<T extends Referenced>

java.lang.Object
  extended by org.jrabbit.base.data.structures.BaseKeyedContainer<T>
      extended by org.jrabbit.base.data.structures.OrderedKeyedContainer<T>
All Implemented Interfaces:
java.lang.Iterable<T>, Factory<T>, Accepter<T>, Container<T>, KeyedContainer<T>, Remover<T>

public class OrderedKeyedContainer<T extends Referenced>
extends BaseKeyedContainer<T>

OrderedKeyedContainer extends BaseKeyedContainter to maintain order of addition.

Author:
Chris Molini

Field Summary
 
Fields inherited from class org.jrabbit.base.data.structures.BaseKeyedContainer
contents, factory
 
Constructor Summary
OrderedKeyedContainer(Factory<T> factory)
          Creates an OrderedKeyedContainer that uses the supplied Factory to make objects on demand.
 
Method Summary
protected  java.util.HashMap<java.lang.String,T> createMap()
          Obtains the HashMap used to maintain the list.
 
Methods inherited from class org.jrabbit.base.data.structures.BaseKeyedContainer
add, add, add, add, clear, contains, contains, create, factory, get, iterator, remove, remove, remove, remove, setFactory, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderedKeyedContainer

public OrderedKeyedContainer(Factory<T> factory)
Creates an OrderedKeyedContainer that uses the supplied Factory to make objects on demand.

Parameters:
factory - The Factory used to create entries on the fly, from String data.
Method Detail

createMap

protected java.util.HashMap<java.lang.String,T> createMap()
Obtains the HashMap used to maintain the list. This overrides the method in KeyedContainer to provide a HashMap that maintains order of addition.

Overrides:
createMap in class BaseKeyedContainer<T extends Referenced>
Returns:
A LinkedHashMap that will key Objects to Strings.