Class ObjectStore<T,K,V>

java.lang.Object
uk.ac.ebi.utils.collections.ObjectStore<T,K,V>
Direct Known Subclasses:
SortedObjectStore

public class ObjectStore<T,K,V> extends Object
Implements an object store. Basically, allows to associate a Java object to a type and a key/identifier. User: brandizi Date: Oct 29, 2007
  • Field Details

    • size

      protected int size
    • log

      protected final org.slf4j.Logger log
  • Constructor Details

    • ObjectStore

      public ObjectStore()
  • Method Details

    • getInternalTypes

      protected Map<T,Map<K,V>> getInternalTypes()
    • put

      public void put(T type, K key, V value)
      Stores an object, identified by a type and an identifier If value is null deletes the entry.
    • remove

      public void remove(T type)
      Remove all the values associated to the type
    • get

      public V get(T type, K key)
      Gets an object identified by type and key. Returns null in case the entry is empty.
    • size

      public int size()
    • types

      public Set<T> types()
      All the types in the store
    • typeKeys

      public Set<K> typeKeys(T type)
      All the identifiers of objects belonging to a given type
    • values

      public Collection<V> values(T type)
      All the values of a certain type. Never returns null.
    • toStringVerbose

      public String toStringVerbose()
      Prints full contents of the object store.