package org.geotools.util
Contains utilities and addition to the collection
framework. Some classes implements the {@link java.util.Set} interface
and provides facilities for mutually exclusive set, caching or
handling ranges of values.
A canonical set of objects, used to optimize memory use.
The operation of this set is similar in spirit to the
String.intern method.
The following example shows a convenient way to use
CanonicalSet as an
internal pool of immutable objects.
public Foo create(String definition) {
Foo created = new Foo(definition);
return (Foo) canonicalSet.unique(created);
}
The
CanonicalSet has a
CanonicalSet.get method that is not part of the
Set interface.
This class is used to maintain a list of listeners, and
is used in the implementations of several classes within JFace
which allow you to register listeners of various kinds.
It is a fairly lightweight object, occupying minimal space when
no listeners are registered.
Note that the add method checks for and eliminates
duplicates based on identity (not equality).
Wraps a
Format object in order to either parse fully a string, or log a warning.
This class provides a
LoggedFormat.parse method which performs the following tasks:
Checks if the string was fully parsed and log a warning if it was not.
A hash map implementation that uses
, leaving memory
when an entry is not used anymore and memory is low.
This map implementation actually maintains some of the first entries as hard references.
Only oldest entries are retained by soft references, in order to avoid too aggressive garbage
collection.