org.apache.batik.css
Class PropertyMap

java.lang.Object
  |
  +--org.apache.batik.css.PropertyMap

public class PropertyMap
extends java.lang.Object

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


Inner Class Summary
protected static class PropertyMap.Entry
          To manage collisions
 
Field Summary
protected  int count
          The number of entries
protected static int INITIAL_CAPACITY
          The initial capacity
protected static float LOAD_FACTOR
          The load factor
protected  PropertyMap.Entry[] table
          The underlying array
 
Constructor Summary
PropertyMap()
          Creates a new table.
PropertyMap(PropertyMap t)
          Creates a copy of the given PropertyMap object.
 
Method Summary
 void clear()
          Clears the map.
 java.lang.Object get(java.lang.Object key)
          Gets the value of a variable
 java.lang.Object item(int index)
          Returns the item at the given position.
 java.lang.Object key(int index)
          Returns the key at the given position or null.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Sets a new value for the given variable
protected  void rehash()
          Rehash the table
 java.lang.Object remove(java.lang.Object key)
          Removes an entry from the table.
 int size()
          Returns the size of this table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOAD_FACTOR

protected static final float LOAD_FACTOR
The load factor

INITIAL_CAPACITY

protected static final int INITIAL_CAPACITY
The initial capacity

table

protected PropertyMap.Entry[] table
The underlying array

count

protected int count
The number of entries
Constructor Detail

PropertyMap

public PropertyMap()
Creates a new table.

PropertyMap

public PropertyMap(PropertyMap t)
Creates a copy of the given PropertyMap object.
Parameters:
t - The table to copy.
Method Detail

size

public int size()
Returns the size of this table.

get

public java.lang.Object get(java.lang.Object key)
Gets the value of a variable
Returns:
the value or null

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Sets a new value for the given variable
Returns:
the old value or null

remove

public java.lang.Object remove(java.lang.Object key)
Removes an entry from the table.
Returns:
the value or null.

key

public java.lang.Object key(int index)
Returns the key at the given position or null.

item

public java.lang.Object item(int index)
Returns the item at the given position.

clear

public void clear()
Clears the map.

rehash

protected void rehash()
Rehash the table


Copyright © 2001 Apache Software Foundation. All Rights Reserved.