public class IntTable
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
protected static class |
IntTable.Entry
To manage collisions.
|
Modifier and Type | Field and Description |
---|---|
protected int |
count
The number of entries
|
protected static int |
INITIAL_CAPACITY
The initial capacity
|
protected IntTable.Entry[] |
table
The underlying array
|
Constructor and Description |
---|
IntTable()
Creates a new table.
|
IntTable(int c)
Creates a new table.
|
IntTable(IntTable t)
Creates a copy of the given HashTable object.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the table.
|
int |
dec(java.lang.Object key)
Decrements the value associated with the given key.
|
protected IntTable.Entry |
find(java.lang.Object key)
Finds the Entry with the given key.
|
int |
get(java.lang.Object key)
Returns the value associated with the given key.
|
int |
inc(java.lang.Object key)
Increments the value associated with the given key.
|
int |
put(java.lang.Object key,
int value)
Sets the value associated with the given key.
|
protected void |
rehash()
Rehashes the table.
|
int |
remove(java.lang.Object key)
Removes an entry from the table.
|
int |
size()
Returns the size of this table.
|
protected static final int INITIAL_CAPACITY
protected IntTable.Entry[] table
protected int count
public IntTable()
public IntTable(int c)
c
- The initial capacity.public IntTable(IntTable t)
t
- The table to copy.public int size()
protected IntTable.Entry find(java.lang.Object key)
public int get(java.lang.Object key)
public int put(java.lang.Object key, int value)
public int inc(java.lang.Object key)
public int dec(java.lang.Object key)
public int remove(java.lang.Object key)
public void clear()
protected void rehash()
Copyright © 2022 Apache Software Foundation. All Rights Reserved.