How do I set up CollapsableHashtable to take parameters?
[code]
/*
* CollapsableHashtable.java
*
* Created on March 20, 2007, 11:17 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package com.ppowell.tools.CollectionTools;
import java.util.Hashtable;
import java.util.Enumeration;
/**
* Allows for "removeAll" of all elements within {@link
java.util.Hashtable}
* @author Phil Powell
* @version JDK 1.6.0
*/
public class CollapsableHashtable<K, V> extends Hashtable<K, V> {
/** Creates a new instance of CollapsableHashtable */
public CollapsableHashtable() {
super();
}
/** Remove all {@link java.lang.Object} keys from {@link
java.util.Hashtable} */
public void removeAll() {
while (!isEmpty()) {
Enumeration keys = this.keys();
while (keys.hasMoreElements()) {
remove(keys.nextElement());
}
}
}
}
[/code]
Sorry folks, I'm so not good at this. How do I ensure that my
CollapsableHashtable class will fully extend Hashtable<K, V> inasmuch
as it will take identifier parameters just like Hashtable<K, V>?
When I try this:
[code]
private Hashtable<String, CollapsableHashtable<String, String>>
phraseHash;
[/code]
I wind up with this compiler error:
[code]
C:\Documents and Settings\me\classes\GUI\src\com\ppowell\applications
\games\RockPaperScissors.java:43: type
com.ppowell.tools.CollectionTools.CollapsableHashtable does not take
parameters
private Hashtable<String, CollapsableHashtable<String, String>>
phraseHash;
[/code]
So what must I do within CollapsableHashtable to ensure that it can
take parameters?
Thanx
Phil