Package org.mozilla.javascript
Class Hashtable
- java.lang.Object
- 
- org.mozilla.javascript.Hashtable
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Iterable<Hashtable.Entry>
 
 public class Hashtable extends java.lang.Object implements java.io.Serializable, java.lang.Iterable<Hashtable.Entry> This generic hash table class is used by Set and Map. It uses a standard HashMap for storing keys and values so that we can handle lots of hash collisions if necessary, and a doubly-linked list to support the iterator capability.This second one is important because JavaScript handling of the iterator is completely different from the way that Java does it. In Java an attempt to modify a collection on a HashMap or LinkedHashMap while iterating through it (except by using the "remove" method on the Iterator object itself) results in a ConcurrentModificationException. JavaScript Maps and Sets explicitly allow the collection to be modified, or even cleared completely, while iterators exist, and even lets an iterator keep on iterating on a collection that was empty when it was created.. - See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classHashtable.EntryOne entry in the hash table.
 - 
Constructor SummaryConstructors Constructor Description Hashtable()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclear()java.lang.Objectdelete(java.lang.Object key)Deprecated.use deleteEntry(Object key) instead because this returns null if the entry was not found or the value of the entry is nullbooleandeleteEntry(java.lang.Object key)java.lang.Objectget(java.lang.Object key)Deprecated.use getEntry(Object key) instead because this returns null if the entry was not found or the value of the entry is nullHashtable.EntrygetEntry(java.lang.Object key)booleanhas(java.lang.Object key)java.util.Iterator<Hashtable.Entry>iterator()voidput(java.lang.Object key, java.lang.Object value)intsize()
 
- 
- 
- 
Method Detail- 
sizepublic int size() 
 - 
putpublic void put(java.lang.Object key, java.lang.Object value)
 - 
getpublic java.lang.Object get(java.lang.Object key) Deprecated.use getEntry(Object key) instead because this returns null if the entry was not found or the value of the entry is null
 - 
getEntrypublic Hashtable.Entry getEntry(java.lang.Object key) 
 - 
haspublic boolean has(java.lang.Object key) 
 - 
deletepublic java.lang.Object delete(java.lang.Object key) Deprecated.use deleteEntry(Object key) instead because this returns null if the entry was not found or the value of the entry is null
 - 
deleteEntrypublic boolean deleteEntry(java.lang.Object key) 
 - 
clearpublic void clear() 
 - 
iteratorpublic java.util.Iterator<Hashtable.Entry> iterator() - Specified by:
- iteratorin interface- java.lang.Iterable<Hashtable.Entry>
 
 
- 
 
-