Module openj9.dtfj
Package com.ibm.j9ddr.vm29.j9
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
Nested Classes Modifier and Type Class Description static interface
HashTable.HashEqualFunction<StructType>
Encapsulation of the equal function needed by the HashTablestatic interface
HashTable.HashFunction<StructType>
Encapsulation of the hash function needed by the HashTable
-
Field Summary
Fields Modifier and Type Field Description protected com.ibm.j9ddr.vm29.j9.HashTable.HashComparatorFunction<StructType>
_comparatorFn
protected HashTable.HashEqualFunction<StructType>
_equalFn
protected HashTable.HashFunction<StructType>
_hashFn
protected Class<StructType>
_structType
protected com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer
_table
-
Constructor Summary
Constructors Modifier Constructor Description 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)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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
getTableName()
Returns the name of the tableabstract SlotIterator<StructType>
iterator()
Returns an iterator over the elements in the pool
-
-
-
Field Detail
-
_table
protected com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer _table
-
_structType
protected Class<StructType extends AbstractPointer> _structType
-
_equalFn
protected HashTable.HashEqualFunction<StructType extends AbstractPointer> _equalFn
-
_hashFn
protected HashTable.HashFunction<StructType extends AbstractPointer> _hashFn
-
_comparatorFn
protected com.ibm.j9ddr.vm29.j9.HashTable.HashComparatorFunction<StructType extends AbstractPointer> _comparatorFn
-
-
Constructor Detail
-
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 Detail
-
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 typeequalFn
- the equal functionhashFn
- the hash function- Returns:
- an instance of HashTable
- Throws:
CorruptDataException
-
getTableName
public abstract String 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
public abstract StructType find(StructType entry) throws CorruptDataException
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
public abstract SlotIterator<StructType> iterator()
Returns an iterator over the elements in the pool- Specified by:
iterator
in interfaceIHashTable<StructType extends AbstractPointer>
- Returns:
- an Iterator
-
-