| bak.pcj.set.AbstractDoubleSet bak.pcj.set.DoubleChainedHashSet
DoubleChainedHashSet | public class DoubleChainedHashSet extends AbstractDoubleSet implements DoubleSet,Cloneable,Serializable(Code) | | This class represents chained hash table based sets of double values.
Unlike the Java Collections HashSet instances of this class
are not backed up by a map. It is implemented using a simple chained
hash table where the keys are stored directly as entries.
See Also: DoubleOpenHashSet See Also: java.util.HashSet author: Søren Bak version: 1.4 21-08-2003 20:05 since: 1.0 |
Field Summary | |
final public static int | DEFAULT_CAPACITY The default capacity of this set. | final public static int | DEFAULT_GROWTH_CHUNK The default chunk size with which to increase the capacity of this set. | final public static double | DEFAULT_GROWTH_FACTOR The default factor with which to increase the capacity of this set. | final public static double | DEFAULT_LOAD_FACTOR The default load factor of this set. |
Constructor Summary | |
public | DoubleChainedHashSet() Creates a new hash set with capacity 11, a relative
growth factor of 1.0, and a load factor of 75%. | public | DoubleChainedHashSet(DoubleCollection c) Creates a new hash set with the same elements as a specified
collection. | public | DoubleChainedHashSet(double[] a) Creates a new hash set with the same elements as the specified
array. | public | DoubleChainedHashSet(int capacity) Creates a new hash set with a specified capacity, a relative
growth factor of 1.0, and a load factor of 75%. | public | DoubleChainedHashSet(double loadFactor) Creates a new hash set with a capacity of 11, a relative
growth factor of 1.0, and a specified load factor. | public | DoubleChainedHashSet(int capacity, double loadFactor) Creates a new hash set with a specified capacity and
load factor, and a relative growth factor of 1.0. | public | DoubleChainedHashSet(int capacity, double loadFactor, double growthFactor) Creates a new hash set with a specified capacity,
load factor, and relative growth factor. | public | DoubleChainedHashSet(int capacity, double loadFactor, int growthChunk) Creates a new hash set with a specified capacity,
load factor, and absolute growth factor.
The set capacity increases to capacity()+growthChunk.
This strategy is good for avoiding wasting memory. | public | DoubleChainedHashSet(DoubleHashFunction keyhash) Creates a new hash set with capacity 11, a relative
growth factor of 1.0, and a load factor of 75%. | public | DoubleChainedHashSet(DoubleHashFunction keyhash, int capacity) Creates a new hash set with a specified capacity, a relative
growth factor of 1.0, and a load factor of 75%. | public | DoubleChainedHashSet(DoubleHashFunction keyhash, double loadFactor) Creates a new hash set with a capacity of 11, a relative
growth factor of 1.0, and a specified load factor. | public | DoubleChainedHashSet(DoubleHashFunction keyhash, int capacity, double loadFactor) Creates a new hash set with a specified capacity and
load factor, and a relative growth factor of 1.0. | public | DoubleChainedHashSet(DoubleHashFunction keyhash, int capacity, double loadFactor, double growthFactor) Creates a new hash set with a specified capacity,
load factor, and relative growth factor. | public | DoubleChainedHashSet(DoubleHashFunction keyhash, int capacity, double loadFactor, int growthChunk) Creates a new hash set with a specified capacity,
load factor, and absolute growth factor.
The set capacity increases to capacity()+growthChunk.
This strategy is good for avoiding wasting memory. |
DEFAULT_CAPACITY | final public static int DEFAULT_CAPACITY(Code) | | The default capacity of this set.
|
DEFAULT_GROWTH_CHUNK | final public static int DEFAULT_GROWTH_CHUNK(Code) | | The default chunk size with which to increase the capacity of this set.
|
DEFAULT_GROWTH_FACTOR | final public static double DEFAULT_GROWTH_FACTOR(Code) | | The default factor with which to increase the capacity of this set.
|
DEFAULT_LOAD_FACTOR | final public static double DEFAULT_LOAD_FACTOR(Code) | | The default load factor of this set.
|
DoubleChainedHashSet | public DoubleChainedHashSet()(Code) | | Creates a new hash set with capacity 11, a relative
growth factor of 1.0, and a load factor of 75%.
|
DoubleChainedHashSet | public DoubleChainedHashSet(DoubleCollection c)(Code) | | Creates a new hash set with the same elements as a specified
collection.
Parameters: c - the collection whose elements to add to the newset. throws: NullPointerException - if c is null. |
DoubleChainedHashSet | public DoubleChainedHashSet(double[] a)(Code) | | Creates a new hash set with the same elements as the specified
array.
Parameters: a - the array whose elements to add to the newset. throws: NullPointerException - if a is null. since: 1.1 |
DoubleChainedHashSet | public DoubleChainedHashSet(int capacity)(Code) | | Creates a new hash set with a specified capacity, a relative
growth factor of 1.0, and a load factor of 75%.
Parameters: capacity - the initial capacity of the set. throws: IllegalArgumentException - if capacity is negative. |
DoubleChainedHashSet | public DoubleChainedHashSet(double loadFactor)(Code) | | Creates a new hash set with a capacity of 11, a relative
growth factor of 1.0, and a specified load factor.
Parameters: loadFactor - the load factor of the set. throws: IllegalArgumentException - if loadFactor is negative. |
DoubleChainedHashSet | public DoubleChainedHashSet(int capacity, double loadFactor)(Code) | | Creates a new hash set with a specified capacity and
load factor, and a relative growth factor of 1.0.
Parameters: capacity - the initial capacity of the set. Parameters: loadFactor - the load factor of the set. throws: IllegalArgumentException - if capacity is negative;if loadFactor is not positive. |
DoubleChainedHashSet | public DoubleChainedHashSet(int capacity, double loadFactor, double growthFactor)(Code) | | Creates a new hash set with a specified capacity,
load factor, and relative growth factor.
The set capacity increases to capacity()*(1+growthFactor).
This strategy is good for avoiding many capacity increases, but
the amount of wasted memory is approximately the size of the set.
Parameters: capacity - the initial capacity of the set. Parameters: loadFactor - the load factor of the set. Parameters: growthFactor - the relative amount with which to increase thethe capacity when a capacity increase is needed. throws: IllegalArgumentException - if capacity is negative;if loadFactor is not positive;if growthFactor is not positive. |
DoubleChainedHashSet | public DoubleChainedHashSet(int capacity, double loadFactor, int growthChunk)(Code) | | Creates a new hash set with a specified capacity,
load factor, and absolute growth factor.
The set capacity increases to capacity()+growthChunk.
This strategy is good for avoiding wasting memory. However, an
overhead is potentially introduced by frequent capacity increases.
Parameters: capacity - the initial capacity of the set. Parameters: loadFactor - the load factor of the set. Parameters: growthChunk - the absolute amount with which to increase thethe capacity when a capacity increase is needed. throws: IllegalArgumentException - if capacity is negative;if loadFactor is not positive;if growthChunk is not positive. |
DoubleChainedHashSet | public DoubleChainedHashSet(DoubleHashFunction keyhash)(Code) | | Creates a new hash set with capacity 11, a relative
growth factor of 1.0, and a load factor of 75%.
Parameters: keyhash - the hash function to use when hashing keys. throws: NullPointerException - if keyhash is null. |
DoubleChainedHashSet | public DoubleChainedHashSet(DoubleHashFunction keyhash, int capacity)(Code) | | Creates a new hash set with a specified capacity, a relative
growth factor of 1.0, and a load factor of 75%.
Parameters: keyhash - the hash function to use when hashing keys. Parameters: capacity - the initial capacity of the set. throws: IllegalArgumentException - if capacity is negative. throws: NullPointerException - if keyhash is null. |
DoubleChainedHashSet | public DoubleChainedHashSet(DoubleHashFunction keyhash, double loadFactor)(Code) | | Creates a new hash set with a capacity of 11, a relative
growth factor of 1.0, and a specified load factor.
Parameters: keyhash - the hash function to use when hashing keys. Parameters: loadFactor - the load factor of the set. throws: IllegalArgumentException - if loadFactor is negative. throws: NullPointerException - if keyhash is null. |
DoubleChainedHashSet | public DoubleChainedHashSet(DoubleHashFunction keyhash, int capacity, double loadFactor)(Code) | | Creates a new hash set with a specified capacity and
load factor, and a relative growth factor of 1.0.
Parameters: keyhash - the hash function to use when hashing keys. Parameters: capacity - the initial capacity of the set. Parameters: loadFactor - the load factor of the set. throws: IllegalArgumentException - if capacity is negative;if loadFactor is not positive. throws: NullPointerException - if keyhash is null. |
DoubleChainedHashSet | public DoubleChainedHashSet(DoubleHashFunction keyhash, int capacity, double loadFactor, double growthFactor)(Code) | | Creates a new hash set with a specified capacity,
load factor, and relative growth factor.
The set capacity increases to capacity()*(1+growthFactor).
This strategy is good for avoiding many capacity increases, but
the amount of wasted memory is approximately the size of the set.
Parameters: keyhash - the hash function to use when hashing keys. Parameters: capacity - the initial capacity of the set. Parameters: loadFactor - the load factor of the set. Parameters: growthFactor - the relative amount with which to increase thethe capacity when a capacity increase is needed. throws: IllegalArgumentException - if capacity is negative;if loadFactor is not positive;if growthFactor is not positive. throws: NullPointerException - if keyhash is null. |
DoubleChainedHashSet | public DoubleChainedHashSet(DoubleHashFunction keyhash, int capacity, double loadFactor, int growthChunk)(Code) | | Creates a new hash set with a specified capacity,
load factor, and absolute growth factor.
The set capacity increases to capacity()+growthChunk.
This strategy is good for avoiding wasting memory. However, an
overhead is potentially introduced by frequent capacity increases.
Parameters: keyhash - the hash function to use when hashing keys. Parameters: capacity - the initial capacity of the set. Parameters: loadFactor - the load factor of the set. Parameters: growthChunk - the absolute amount with which to increase thethe capacity when a capacity increase is needed. throws: IllegalArgumentException - if capacity is negative;if loadFactor is not positive;if growthChunk is not positive. throws: NullPointerException - if keyhash is null. |
add | public boolean add(double v)(Code) | | |
clear | public void clear()(Code) | | |
clone | public Object clone()(Code) | | Returns a clone of this hash set.
a clone of this hash set. since: 1.1 |
contains | public boolean contains(double v)(Code) | | |
hashCode | public int hashCode()(Code) | | |
remove | public boolean remove(double v)(Code) | | |
toArray | public double[] toArray(double[] a)(Code) | | |
trimToSize | public void trimToSize()(Code) | | |
|
|