| |
|
| java.lang.Object javolution.util.FastCollection javolution.util.FastSet
All known Subclasses: j2me.util.LinkedHashSet, j2me.util.HashSet,
FastSet | public class FastSet extends FastCollection implements Set,Reusable(Code) | | This class represents a set collection backed by a
FastMap ;
smooth capacity increase and no rehashing ever performed.
FastSet , as for any
FastCollection sub-class, supports
thread-safe fast iterations without using iterators. For example:[code]
for (FastSet.Record r = set.head(), end = set.tail(); (r = r.getNext()) != end;) {
Object value = set.valueOf(r);
}[/code]
author: Jean-Marie Dautelle version: 4.2, December 18, 2006 |
Constructor Summary | |
public | FastSet() Creates a set of small initial capacity. | public | FastSet(String id) Creates a persistent set associated to the specified unique identifier
(convenience method). | public | FastSet(int capacity) Creates a set of specified initial capacity; unless the set size
reaches the specified capacity, operations on this set will not allocate
memory (no lazy object creation). | public | FastSet(Set elements) Creates a set containing the specified elements, in the order they
are returned by the set iterator. |
FastSet | public FastSet()(Code) | | Creates a set of small initial capacity.
|
FastSet | public FastSet(String id)(Code) | | Creates a persistent set associated to the specified unique identifier
(convenience method).
Parameters: id - the unique identifier for this map. throws: IllegalArgumentException - if the identifier is not unique. See Also: javolution.context.PersistentContext.Reference |
FastSet | public FastSet(int capacity)(Code) | | Creates a set of specified initial capacity; unless the set size
reaches the specified capacity, operations on this set will not allocate
memory (no lazy object creation).
Parameters: capacity - the initial capacity. |
FastSet | public FastSet(Set elements)(Code) | | Creates a set containing the specified elements, in the order they
are returned by the set iterator.
Parameters: elements - the elements to be placed into this fast set. |
add | final public boolean add(Object value)(Code) | | Adds the specified value to this set if it is not already present.
Parameters: value - the value to be added to this set. true if this set did not already contain the specified element. throws: NullPointerException - if the value is null . |
clear | final public void clear()(Code) | | |
delete | final public void delete(Record record)(Code) | | |
head | final public Record head()(Code) | | |
reset | public void reset()(Code) | | |
setValueComparator | public FastSet setValueComparator(FastComparator comparator)(Code) | | Sets the comparator to use for value equality.
Parameters: comparator - the value comparator. this |
size | final public int size()(Code) | | Returns the number of elements in this set (its cardinality).
the number of elements in this set (its cardinality). |
tail | final public Record tail()(Code) | | |
|
|
|