Class UniqueItemIndex<T>

java.lang.Object
toxi.util.datatypes.UniqueItemIndex<T>
All Implemented Interfaces:
ItemIndex<T>
Direct Known Subclasses:
SpatialIndex

public class UniqueItemIndex<T> extends Object implements ItemIndex<T>
This class is used to build an unique set of items and offers a bi-directional mapping between items and their associated ID values. Items are added via the index(Object) method and removed via unindex(Object). The item's Object.hashCode() is used as unique identifier, so you MUST ensure the item class satisfies the contract of Object.hashCode() and Object.equals(Object).
  • Constructor Details

    • UniqueItemIndex

      public UniqueItemIndex()
    • UniqueItemIndex

      public UniqueItemIndex(Collection<T> items)
  • Method Details