Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.port80.util.struct
Class IntValueHashMap  view IntValueHashMap download IntValueHashMap.java

java.lang.Object
  extended bycom.port80.util.struct.IntValueHashMap

public class IntValueHashMap
extends java.lang.Object

Object->int hash.


Field Summary
(package private)  int capacity
          Number of entries.
 java.lang.Object[] keyTable
           
(package private)  int size
           
(package private)  int threshold
          Size of hash table.
 int[] valueTable
           
 
Constructor Summary
IntValueHashMap()
          Capacity increase if size>=threshold.
IntValueHashMap(int threshold)
           
 
Method Summary
 boolean containsKey(java.lang.Object key)
           
 int get(java.lang.Object key)
          Returns the value at the given key.
 java.util.Set keySet()
          Return the keys.
static void main(java.lang.String[] args)
           
 int put(java.lang.Object key, int value)
           
private  void rehash()
           
 int size()
           
 java.lang.Object[] sortedKeys()
           
 java.lang.Object[] sortedKeys(int maxValue)
           
private static void test()
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

keyTable

public java.lang.Object[] keyTable

valueTable

public int[] valueTable

size

int size

capacity

int capacity
Number of entries.


threshold

int threshold
Size of hash table.

Constructor Detail

IntValueHashMap

public IntValueHashMap()
Capacity increase if size>=threshold.


IntValueHashMap

public IntValueHashMap(int threshold)
Method Detail

containsKey

public boolean containsKey(java.lang.Object key)

get

public int get(java.lang.Object key)
Returns the value at the given key. Returns -1 if not found.


put

public int put(java.lang.Object key,
               int value)

size

public int size()

keySet

public java.util.Set keySet()
Return the keys.


sortedKeys

public java.lang.Object[] sortedKeys(int maxValue)

sortedKeys

public java.lang.Object[] sortedKeys()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


rehash

private void rehash()

main

public static void main(java.lang.String[] args)

test

private static void test()