| bak.pcj.set.AbstractFloatSet bak.pcj.set.FloatOpenHashSet
FloatOpenHashSet | public class FloatOpenHashSet extends AbstractFloatSet implements FloatSet,Cloneable,Serializable(Code) | | This class represents open addressing hash table based sets of float values.
Unlike the Java Collections HashSet instances of this class
are not backed up by a map. It is implemented using a simple open addressing
hash table where the keys are stored directly as entries.
See Also: FloatOpenHashSet See Also: java.util.HashSet author: Søren Bak version: 1.3 22-08-2003 20:19 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 | FloatOpenHashSet() Creates a new hash set with capacity 11, a relative
growth factor of 1.0, and a load factor of 75%. | public | FloatOpenHashSet(FloatCollection c) Creates a new hash set with the same elements as a specified
collection. | public | FloatOpenHashSet(float[] a) Creates a new hash set with the same elements as the specified
array. | public | FloatOpenHashSet(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 | FloatOpenHashSet(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 | FloatOpenHashSet(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 | FloatOpenHashSet(int capacity, double loadFactor, double growthFactor) Creates a new hash set with a specified capacity,
load factor, and relative growth factor. | public | FloatOpenHashSet(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 | FloatOpenHashSet(FloatHashFunction keyhash) Creates a new hash set with capacity 11, a relative
growth factor of 1.0, and a load factor of 75%. | public | FloatOpenHashSet(FloatHashFunction 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 | FloatOpenHashSet(FloatHashFunction 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 | FloatOpenHashSet(FloatHashFunction 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 | FloatOpenHashSet(FloatHashFunction keyhash, int capacity, double loadFactor, double growthFactor) Creates a new hash set with a specified capacity,
load factor, and relative growth factor. | public | FloatOpenHashSet(FloatHashFunction keyhash, int capacity, double loadFactor, int growthChunk) Creates a new hash set with a specified capacity,
load factor, and absolute growth factor.
Parameters: keyhash - the hash function to use when hashing keys.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.
|
FloatOpenHashSet | public FloatOpenHashSet()(Code) | | Creates a new hash set with capacity 11, a relative
growth factor of 1.0, and a load factor of 75%.
|
FloatOpenHashSet | public FloatOpenHashSet(FloatCollection 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. |
FloatOpenHashSet | public FloatOpenHashSet(float[] 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 |
FloatOpenHashSet | public FloatOpenHashSet(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. |
FloatOpenHashSet | public FloatOpenHashSet(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 or zero. |
FloatOpenHashSet | public FloatOpenHashSet(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. |
FloatOpenHashSet | public FloatOpenHashSet(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. |
FloatOpenHashSet | public FloatOpenHashSet(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. |
FloatOpenHashSet | public FloatOpenHashSet(FloatHashFunction 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. |
FloatOpenHashSet | public FloatOpenHashSet(FloatHashFunction 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. |
FloatOpenHashSet | public FloatOpenHashSet(FloatHashFunction 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 or zero. throws: NullPointerException - if keyhash is null. |
FloatOpenHashSet | public FloatOpenHashSet(FloatHashFunction 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. |
FloatOpenHashSet | public FloatOpenHashSet(FloatHashFunction 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. |
FloatOpenHashSet | public FloatOpenHashSet(FloatHashFunction keyhash, int capacity, double loadFactor, int growthChunk)(Code) | | Creates a new hash set with a specified capacity,
load factor, and absolute growth factor.
Parameters: keyhash - the hash function to use when hashing keys.The set capacity increases to capacity()+growthChunk.This strategy is good for avoiding wasting memory. However, anoverhead 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. throws: NullPointerException - if keyhash is null. |
add | public boolean add(float 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(float v)(Code) | | |
hashCode | public int hashCode()(Code) | | |
remove | public boolean remove(float v)(Code) | | |
toArray | public float[] toArray(float[] a)(Code) | | |
trimToSize | public void trimToSize()(Code) | | |
|
|