org.apache.batik.css.engine.value
Class StringMap

java.lang.Object
  extended by org.apache.batik.css.engine.value.StringMap

public class StringMap
extends Object

A simple hashtable, not synchronized, with fixed load factor and with equality test made with '=='.


Nested Class Summary
protected static class StringMap.Entry
          To manage collisions
 
Field Summary
protected  int count
          The number of entries
protected static int INITIAL_CAPACITY
          The initial capacity
protected  StringMap.Entry[] table
          The underlying array
 
Constructor Summary
StringMap()
          Creates a new table.
StringMap(StringMap t)
          Creates a copy of the given StringMap object.
 
Method Summary
 Object get(String key)
          Gets the value corresponding to the given string.
 Object put(String key, Object value)
          Sets a new value for the given variable
protected  void rehash()
          Rehash the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_CAPACITY

protected static final int INITIAL_CAPACITY
The initial capacity

See Also:
Constant Field Values

table

protected StringMap.Entry[] table
The underlying array


count

protected int count
The number of entries

Constructor Detail

StringMap

public StringMap()
Creates a new table.


StringMap

public StringMap(StringMap t)
Creates a copy of the given StringMap object.

Parameters:
t - The table to copy.
Method Detail

get

public Object get(String key)
Gets the value corresponding to the given string.

Returns:
the value or null

put

public Object put(String key,
                  Object value)
Sets a new value for the given variable

Returns:
the old value or null

rehash

protected void rehash()
Rehash the table



Copyright © 2008 Apache Software Foundation. All Rights Reserved.