package hash;

/**
 * Class to test the Hash Table
 * @author Winston Prakash
 */
public class HashTableTester {
    
    /** Creates a new instance of Main */
    public HashTableTester() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        String[] keys = {"one", "two", "three"};
        String[] values = {"value1", "value2", "value3"};
        HashTable<String, String> hashTable = new ChainingHashTable<String, String>();
        for(int i=0; i<keys.length; i++ ){
            hashTable.put(keys[i], values[i]);
        }
        hashTable.display();
        System.out.println();
        String key = "two";
        System.out.println("The value of key " + key + " is " + hashTable.get(key));
        key = "one";
        System.out.println("The value of key " + key + " is " + hashTable.get(key));
        System.out.println();
        key = "three";
        System.out.println("Removing the value of key " + key);
        System.out.println();
        hashTable.remove(key);
        hashTable.display();
        System.out.println();
        System.out.println("Is the key " + key + " exists - " + hashTable.contains(key));
        System.out.println();
        key = "one";
        System.out.println("Is the key " + key + " exists - " + hashTable.contains(key));
    }
    
}