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 class
Hash.HashEntry<V>
class
Hash.HashEntryIterator
class
Hash.HashIterator
-
Field Summary
Fields Modifier and Type Field Description private static int
HASH_SIGN_BIT_MASK
protected Hash.HashEntry<V>
head
private static int
INITIAL_CAPACITY
private static int
MAXIMUM_CAPACITY
private static int
MIN_CAPA
private static int[]
PRIMES
protected int
size
protected Hash.HashEntry<V>[]
table
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static int
bucketIndex(int h, int length)
protected void
checkResize()
Hash.HashEntryIterator
entryIterator()
protected static int
hashValue(int h)
protected abstract void
init()
java.util.Iterator<V>
iterator()
protected void
resize(int newCapacity)
int
size()
-
-
-
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:
iterator
in interfacejava.lang.Iterable<V>
-
entryIterator
public Hash.HashEntryIterator entryIterator()
-
-