Package org.jcodings.util
Class Hash<V>
- java.lang.Object
-
- org.jcodings.util.Hash<V>
-
- All Implemented Interfaces:
java.lang.Iterable<V>
- Direct Known Subclasses:
BytesHash,CaseInsensitiveBytesHash,IntArrayHash,IntHash,ObjHash
public abstract class Hash<V> extends java.lang.Object implements java.lang.Iterable<V>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHash.HashEntry<V>classHash.HashEntryIteratorclassHash.HashIterator
-
Field Summary
Fields Modifier and Type Field Description private static intHASH_SIGN_BIT_MASKprotected Hash.HashEntry<V>headprivate static intINITIAL_CAPACITYprivate static intMAXIMUM_CAPACITYprivate static intMIN_CAPAprivate static int[]PRIMESprotected intsizeprotected Hash.HashEntry<V>[]table
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static intbucketIndex(int h, int length)protected voidcheckResize()Hash.HashEntryIteratorentryIterator()protected static inthashValue(int h)protected abstract voidinit()java.util.Iterator<V>iterator()protected voidresize(int newCapacity)intsize()
-
-
-
Field Detail
-
table
protected Hash.HashEntry<V>[] table
-
size
protected int size
-
PRIMES
private static final int[] PRIMES
-
INITIAL_CAPACITY
private static final int INITIAL_CAPACITY
-
MAXIMUM_CAPACITY
private static final int MAXIMUM_CAPACITY
- See Also:
- Constant Field Values
-
head
protected Hash.HashEntry<V> head
-
MIN_CAPA
private static final int MIN_CAPA
- See Also:
- Constant Field Values
-
HASH_SIGN_BIT_MASK
private static final int HASH_SIGN_BIT_MASK
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
protected abstract void init()
-
size
public final int size()
-
checkResize
protected final void checkResize()
-
resize
protected final void resize(int newCapacity)
-
bucketIndex
protected static int bucketIndex(int h, int length)
-
hashValue
protected static int hashValue(int h)
-
iterator
public java.util.Iterator<V> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<V>
-
entryIterator
public Hash.HashEntryIterator entryIterator()
-
-