Class HashTable<StructType extends AbstractPointer>
java.lang.Object
com.ibm.j9ddr.vm29.j9.HashTable<StructType>
- All Implemented Interfaces:
IHashTable<StructType>
- Direct Known Subclasses:
HashTable_V1
public abstract class HashTable<StructType extends AbstractPointer>
extends Object
implements IHashTable<StructType>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Encapsulation of the equal function needed by the HashTablestatic interface
Encapsulation of the hash function needed by the HashTable -
Field Summary
Modifier and TypeFieldDescriptionprotected com.ibm.j9ddr.vm29.j9.HashTable.HashComparatorFunction
<StructType> protected HashTable.HashEqualFunction
<StructType> protected HashTable.HashFunction
<StructType> protected Class
<StructType> protected com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer
-
Constructor Summary
ModifierConstructorDescriptionprotected
HashTable
(com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer structure, Class<StructType> structType, HashTable.HashEqualFunction<StructType> equalFn, HashTable.HashFunction<StructType> hashFn, com.ibm.j9ddr.vm29.j9.HashTable.HashComparatorFunction<StructType> comparatorFn) -
Method Summary
Modifier and TypeMethodDescriptionabstract StructType
find
(StructType entry) Find an entry in the hash table.static <T extends AbstractPointer>
HashTable<T> fromJ9HashTable
(com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer structure, boolean isInline, Class<T> structType, HashTable.HashEqualFunction<T> equalFn, HashTable.HashFunction<T> hashFn) Factory method to construct an appropriate hashtable handler.static <T extends AbstractPointer>
HashTable<T> fromJ9HashTable
(com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer structure, boolean isInline, Class<T> structType, HashTable.HashFunction<T> hashFn, com.ibm.j9ddr.vm29.j9.HashTable.HashComparatorFunction<T> comparatorFn) Factory method to construct an appropriate hashtable handler.abstract long
getCount()
Returns the number of elements in a given pool.abstract String
Returns the name of the tableabstract SlotIterator
<StructType> iterator()
Returns an iterator over the elements in the pool
-
Field Details
-
_table
protected com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer _table -
_structType
-
_equalFn
-
_hashFn
-
_comparatorFn
protected com.ibm.j9ddr.vm29.j9.HashTable.HashComparatorFunction<StructType extends AbstractPointer> _comparatorFn
-
-
Constructor Details
-
HashTable
protected HashTable(com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer structure, Class<StructType> structType, HashTable.HashEqualFunction<StructType> equalFn, HashTable.HashFunction<StructType> hashFn, com.ibm.j9ddr.vm29.j9.HashTable.HashComparatorFunction<StructType> comparatorFn) throws CorruptDataException - Throws:
CorruptDataException
-
-
Method Details
-
fromJ9HashTable
public static <T extends AbstractPointer> HashTable<T> fromJ9HashTable(com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer structure, boolean isInline, Class<T> structType, HashTable.HashEqualFunction<T> equalFn, HashTable.HashFunction<T> hashFn) throws CorruptDataException Factory method to construct an appropriate hashtable handler.- Type Parameters:
T
-- Parameters:
structure
- the J9HashTable structure to usestructType
- the element typeequalFn
- the equal functionhashFn
- the hash function- Returns:
- an instance of HashTable
- Throws:
CorruptDataException
-
fromJ9HashTable
public static <T extends AbstractPointer> HashTable<T> fromJ9HashTable(com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer structure, boolean isInline, Class<T> structType, HashTable.HashFunction<T> hashFn, com.ibm.j9ddr.vm29.j9.HashTable.HashComparatorFunction<T> comparatorFn) throws CorruptDataException Factory method to construct an appropriate hashtable handler.- Type Parameters:
T
-- Parameters:
structure
- the J9HashTable structure to usestructType
- the element typehashFn
- the hash functionequalFn
- the equal function- Returns:
- an instance of HashTable
- Throws:
CorruptDataException
-
getTableName
Returns the name of the table- Specified by:
getTableName
in interfaceIHashTable<StructType extends AbstractPointer>
- Returns:
- the number of elements in the pool
-
getCount
public abstract long getCount()Returns the number of elements in a given pool.- Specified by:
getCount
in interfaceIHashTable<StructType extends AbstractPointer>
- Returns:
- the number of elements in the pool
-
find
Find an entry in the hash table.- Parameters:
entry
-- Returns:
- NULL if entry is not present in the table; otherwise a pointer to the user-data
- Throws:
CorruptDataException
-
iterator
Returns an iterator over the elements in the pool- Specified by:
iterator
in interfaceIHashTable<StructType extends AbstractPointer>
- Returns:
- an Iterator
-