org.htmlparser.util
Class SpecialHashtable

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byorg.htmlparser.util.SpecialHashtable
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class SpecialHashtable
extends java.util.Hashtable

Acts like a regular HashTable, except some values are translated in get(String). Specifically, Tag.NULLVALUE is translated to null and Tag.NOTHING is translated to "". This is done for backwards compatibility, users are expecting a HashTable, but Tag.toHTML needs to know when there is no attribute value (<

See Also:
Serialized Form

Field Summary
static java.lang.String NOTHING
          Special value for an empty attribute value.
static java.lang.String NULLVALUE
          Special value for a null attribute value.
static java.lang.String TAGNAME
          Special key for the tag name.
 
Constructor Summary
SpecialHashtable()
          Constructs a new, empty hashtable with a default initial capacity (11) and load factor, which is 0.75.
SpecialHashtable(int initialCapacity)
          Constructs a new, empty hashtable with the specified initial capacity and default load factor, which is 0.75.
SpecialHashtable(int initialCapacity, float loadFactor)
          Constructs a new, empty hashtable with the specified initial capacity and the specified load factor.
 
Method Summary
 java.lang.Object get(java.lang.Object key)
          Returns the value to which the specified key is mapped in this hashtable.
 java.lang.Object getRaw(java.lang.Object key)
          Returns the raw (untranslated) value to which the specified key is mapped in this hashtable.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TAGNAME

public static final java.lang.String TAGNAME
Special key for the tag name.

See Also:
Constant Field Values

NULLVALUE

public static final java.lang.String NULLVALUE
Special value for a null attribute value.

See Also:
Constant Field Values

NOTHING

public static final java.lang.String NOTHING
Special value for an empty attribute value.

See Also:
Constant Field Values
Constructor Detail

SpecialHashtable

public SpecialHashtable()
Constructs a new, empty hashtable with a default initial capacity (11) and load factor, which is 0.75.


SpecialHashtable

public SpecialHashtable(int initialCapacity)
Constructs a new, empty hashtable with the specified initial capacity and default load factor, which is 0.75.


SpecialHashtable

public SpecialHashtable(int initialCapacity,
                        float loadFactor)
Constructs a new, empty hashtable with the specified initial capacity and the specified load factor.

Method Detail

get

public java.lang.Object get(java.lang.Object key)
Returns the value to which the specified key is mapped in this hashtable. This is translated to provide backwards compatibility.

Returns:
The translated value of the attribute. This will be null if the attribute is a stand-alone attribute.

getRaw

public java.lang.Object getRaw(java.lang.Object key)
Returns the raw (untranslated) value to which the specified key is mapped in this hashtable.