edu.mit.ai.psg.utilities
Class VectorMap

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--edu.mit.ai.psg.utilities.VectorMap

public class VectorMap
extends AbstractMap
implements Cloneable

VectorMap is a debugging implementation of Map using a java.util.Vector of alternating keys and values, which is easier to browse in a debugger than a hash table. This is purposely flat, as debuggers can display the storage array as {key1, val1, key2, val2, ...}. The iterator is simple and quick; it may omit or repeat items if elements are removed or added during the iteration.


Constructor Summary
VectorMap()
           
VectorMap(Map initElements)
           
VectorMap(Object[] initElements)
          initialize with array containing key1, val1, key2, val2, ...
 
Method Summary
 Object clone()
           
 Set entrySet()
           
 Object get(Object key)
           
 boolean isEmpty()
           
 Object put(Object key, Object newVal)
           
 Object remove(Object key)
           
 int size()
           
 void trimToSize()
           
 
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, keySet, putAll, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VectorMap

public VectorMap()

VectorMap

public VectorMap(Map initElements)

VectorMap

public VectorMap(Object[] initElements)
initialize with array containing key1, val1, key2, val2, ...
Method Detail

size

public int size()
Overrides:
size in class AbstractMap

isEmpty

public boolean isEmpty()
Overrides:
isEmpty in class AbstractMap

get

public Object get(Object key)
Overrides:
get in class AbstractMap

put

public Object put(Object key,
                  Object newVal)
Overrides:
put in class AbstractMap

remove

public Object remove(Object key)
Overrides:
remove in class AbstractMap

clone

public Object clone()
Overrides:
clone in class Object

trimToSize

public void trimToSize()

entrySet

public Set entrySet()
Overrides:
entrySet in class AbstractMap

Copyright (c) 1996-1999
Massachusetts Institute of Technology

Feedback: jeva-feedback@ai.mit.edu