| bak.pcj.set.AbstractByteSet bak.pcj.set.ByteOpenHashSet
ByteOpenHashSet | public class ByteOpenHashSet extends AbstractByteSet implements ByteSet,Cloneable,Serializable(Code) | | This class represents open addressing hash table based sets of byte 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: ByteOpenHashSet 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 | ByteOpenHashSet() Creates a new hash set with capacity 11, a relative
growth factor of 1.0, and a load factor of 75%. | public | ByteOpenHashSet(ByteCollection c) Creates a new hash set with the same elements as a specified
collection. | public | ByteOpenHashSet(byte[] a) Creates a new hash set with the same elements as the specified
array. | public | ByteOpenHashSet(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 | ByteOpenHashSet(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 | ByteOpenHashSet(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 | ByteOpenHashSet(int capacity, double loadFactor, double growthFactor) Creates a new hash set with a specified capacity,
load factor, and relative growth factor. | public | ByteOpenHashSet(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 | ByteOpenHashSet(ByteHashFunction keyhash) Creates a new hash set with capacity 11, a relative
growth factor of 1.0, and a load factor of 75%. | public | ByteOpenHashSet(ByteHashFunction 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 | ByteOpenHashSet(ByteHashFunction 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 | ByteOpenHashSet(ByteHashFunction 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 | ByteOpenHashSet(ByteHashFunction keyhash, int capacity, double loadFactor, double growthFactor) Creates a new hash set with a specified capacity,
load factor, and relative growth factor. | public | ByteOpenHashSet(ByteHashFunction 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.
|
ByteOpenHashSet | public ByteOpenHashSet()(Code) | | Creates a new hash set with capacity 11, a relative
growth factor of 1.0, and a load factor of 75%.
|
ByteOpenHashSet | public ByteOpenHashSet(ByteCollection 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. |
ByteOpenHashSet | public ByteOpenHashSet(byte[] 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 |
ByteOpenHashSet | public ByteOpenHashSet(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. |
ByteOpenHashSet | public ByteOpenHashSet(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. |
ByteOpenHashSet | public ByteOpenHashSet(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. |
ByteOpenHashSet | public ByteOpenHashSet(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. |
ByteOpenHashSet | public ByteOpenHashSet(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. |
ByteOpenHashSet | public ByteOpenHashSet(ByteHashFunction 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. |
ByteOpenHashSet | public ByteOpenHashSet(ByteHashFunction 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. |
ByteOpenHashSet | public ByteOpenHashSet(ByteHashFunction 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. |
ByteOpenHashSet | public ByteOpenHashSet(ByteHashFunction 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. |
ByteOpenHashSet | public ByteOpenHashSet(ByteHashFunction 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. |
ByteOpenHashSet | public ByteOpenHashSet(ByteHashFunction 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(byte 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(byte v)(Code) | | |
hashCode | public int hashCode()(Code) | | |
remove | public boolean remove(byte v)(Code) | | |
toArray | public byte[] toArray(byte[] a)(Code) | | |
trimToSize | public void trimToSize()(Code) | | |
|
|