Table of Contents

Class IntHashtable

Namespace
iText.IO.Util
Assembly
itext.io.dll

A hash map that uses primitive ints for the key rather than objects.

public class IntHashtable
Inheritance
IntHashtable
Inherited Members

Remarks

A hash map that uses primitive ints for the key rather than objects.

Note that this class is for internal optimization purposes only, and may not be supported in future releases of Jakarta Commons Lang. Utilities of this sort may be included in future releases of Jakarta Commons Collections.

Constructors

IntHashtable()

Constructs a new, empty hashtable with a default capacity and load factor, which is 20 and 0.75 respectively.

public IntHashtable()

IntHashtable(int)

Constructs a new, empty hashtable with the specified initial capacity and default load factor, which is 0.75.

public IntHashtable(int initialCapacity)

Parameters

initialCapacity int

the initial capacity of the hashtable.

IntHashtable(int, float)

Constructs a new, empty hashtable with the specified initial capacity and the specified load factor.

public IntHashtable(int initialCapacity, float loadFactor)

Parameters

initialCapacity int

the initial capacity of the hashtable.

loadFactor float

the load factor of the hashtable.

IntHashtable(IntHashtable)

public IntHashtable(IntHashtable o)

Parameters

o IntHashtable

Methods

Clear()

Clears this hashtable so that it contains no keys.

public virtual void Clear()

Clone()

public virtual object Clone()

Returns

object

Contains(int)

Tests if some key maps into the specified value in this hashtable.

public virtual bool Contains(int value)

Parameters

value int

a value to search for.

Returns

bool

true if and only if some key maps to the value argument in this hashtable as determined by the equals method; false otherwise.

Remarks

Tests if some key maps into the specified value in this hashtable. This operation is more expensive than the containsKey method.

Note that this method is identical in functionality to containsValue, (which is part of the Map interface in the collections framework).
See Also

ContainsKey(int)

Tests if the specified int is a key in this hashtable.

public virtual bool ContainsKey(int key)

Parameters

key int

possible key.

Returns

bool

true if and only if the specified int is a key in this hashtable, as determined by the equals method; false otherwise.

See Also

ContainsValue(int)

Returns true if this HashMap maps one or more keys to this value.

public virtual bool ContainsValue(int value)

Parameters

value int

value whose presence in this HashMap is to be tested.

Returns

bool

boolean true if the value is contained

Remarks

Returns true if this HashMap maps one or more keys to this value.

Note that this method is identical in functionality to contains (which predates the Map interface).

Get(int)

Returns the value to which the specified key is mapped in this map.

public virtual int Get(int key)

Parameters

key int

a key in the hashtable.

Returns

int

the value to which the key is mapped in this hashtable; 0 if the key is not mapped to any value in this hashtable.

See Also

GetKeys()

public virtual int[] GetKeys()

Returns

int[]

GetOneKey()

public virtual int GetOneKey()

Returns

int

IsEmpty()

Tests if this hashtable maps no keys to values.

public virtual bool IsEmpty()

Returns

bool

true if this hashtable maps no keys to values; false otherwise.

Put(int, int)

Maps the specified key to the specified value in this hashtable.

public virtual int Put(int key, int value)

Parameters

key int

the hashtable key.

value int

the value.

Returns

int

the previous value of the specified key in this hashtable, or null if it did not have one.

Remarks

Maps the specified key to the specified value in this hashtable. The key cannot be null.

The value can be retrieved by calling the get method with a key that is equal to the original key.
See Also

Rehash()

Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently.

protected virtual void Rehash()

Remarks

Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently.

This method is called automatically when the number of keys in the hashtable exceeds this hashtable's capacity and load factor.

Remove(int)

Removes the key (and its corresponding value) from this hashtable.

public virtual int Remove(int key)

Parameters

key int

the key that needs to be removed.

Returns

int

the value to which the key had been mapped in this hashtable, or null if the key did not have a mapping.

Remarks

Removes the key (and its corresponding value) from this hashtable.

This method does nothing if the key is not present in the hashtable.

Size()

Returns the number of keys in this hashtable.

public virtual int Size()

Returns

int

the number of keys in this hashtable.

ToOrderedKeys()

public virtual int[] ToOrderedKeys()

Returns

int[]