# Package org.apache.sis.util.collection

package org.apache.sis.util.collection
Addition to the collection framework. Most classes in this package implement interfaces from the Java Collection Framework defined in the `java​.util` package.

- `WeakHashSet` provides a way to ensure that a factory returns unique instances for all values that are equal in the sense of `Objects​.deepEquals(Object, Object)`. The values that were created in previous factory operations are retained by weak references for reuse.
- `Cache` and `WeakValueHashMap` are `java​.util​.Map` implementations that may be used for some caching or pseudo-caching functionalities. The `Cache` implementation is the most full-featured one and supports concurrency, while the other implementations are more lightweight, sometimes thread-safe but without concurrency support.
- Derived Map and derived Set are wrapper collections in which the keys or the values are derived on-the-fly from the content of another collection. The can also be used for creating filtered views.
- `IntegerList`, `CodeListSet` and `RangeSet` are collections specialized for a particular kind of content, providing more efficient storage than what we would get with the general-purpose collection implementations.
- `FrequencySortedSet` provides specialized ways to organize its elements.

Since:
  0.3

- Related Packages
  Module
  Package
  Description
  org.apache.sis.util
  org.apache.sis.util
  Simple data objects and miscellaneous utilities.
  org.apache.sis.metadata
  org.apache.sis.util.iso
  Implementations of GeoAPI types from the `org​.opengis​.util` package.
  org.apache.sis.util
  org.apache.sis.util.logging
  Extensions to the JDK logging framework.
- Class
  Description
  BackingStoreException
  Thrown to indicate that an operation could not complete because of a failure in the backing store (a file or a database).
  Cache<K,V>
  A concurrent map capable to locks entries for which the value is in process of being computed.
  Cache.Handler<V>
  The handler returned by `Cache​.lock(K)`, to be used for unlocking and storing the result.
  CheckedContainer<E>
  A container that ensures that all elements are assignable to a given base type.
  CodeListSet<E extends CodeList<E>>
  A specialized `Set` implementation for use with `CodeList` values.
  Containers
  Static methods working on `Collection` or `CheckedContainer` objects.
  DefaultTreeTable
  A `TreeTable` implementation with a list of columns given at construction time.
  DefaultTreeTable.Node
  A `TreeTable​.Node` implementation which can store values for a predefined list of columns.
  FrequencySortedSet<E>
  A set with elements ordered by the amount of time they were added.
  IntegerList
  A list of unsigned integer values.
  RangeSet<E extends Comparable<? super E>>
  An ordered set of disjoint ranges where overlapping ranges are merged.
  TableColumn<V>
  Identifies a column in `TreeTable​.Node` instances.
  TreeTable
  Defines the structure (list of columns) of a table and provides the root of the tree containing the data.
  TreeTable.Node
  A node in a tree combined with a row in a table.
  TreeTableFormat
  A parser and formatter for `TreeTable` instances.
  TreeTables
  Static methods working on `TreeTable` objects and their nodes.
  WeakHashSet<E>
  A set of objects hold by weak references.
  WeakValueHashMap<K,V>
  A hashtable-based map implementation that uses weak references, leaving memory when an entry is not used anymore.