iglu.util
Class ActiveValueSortedMap

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--iglu.util.ValueSortedMap
              |
              +--iglu.util.ActiveValueSortedMap
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class ActiveValueSortedMap
extends ValueSortedMap

A value sorted map that issues events.

Author:
Travis Bauer
See Also:
Serialized Form

Field Summary
private  java.util.LinkedList eventListeners
          the event queue
 
Fields inherited from class iglu.util.ValueSortedMap
EMPTY, forwardSortedVector, reverseSortedVector, storedItems
 
Fields inherited from class java.util.AbstractMap
 
Constructor Summary
ActiveValueSortedMap()
          Creates new ActiveValueSortedMap
ActiveValueSortedMap(java.util.Map map)
          Create a new AVSM from the given map.
 
Method Summary
 void addVSMEventListener(VSMEventListener el)
          ad a new event listener
 void clear()
          Removes all items from the map and fires an event.
 void fireEvent(VSMEvent e)
          issue the event named
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Puts an object into the map and fires the event.
 void putAll(java.util.Map map)
          Puts all the objects into the map and fires the event.
 java.lang.Object remove(java.lang.Object key)
          Removes an object from the event and fires the event.
 java.lang.Object update(java.lang.Object key, double value)
           
 java.lang.Object update(java.lang.Object key, java.lang.Object value)
           
 
Methods inherited from class iglu.util.ValueSortedMap
clone, containsKey, entrySet, get, getDouble, isEmpty, iterator, keyIterator, keySet, linearlyScale, main, normalize, put, rankOrder, reverseKeyIterator, scaleBy, size, subtract, test, toString, truncateTo
 
Methods inherited from class java.util.AbstractMap
containsValue, equals, hashCode, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

eventListeners

private java.util.LinkedList eventListeners
the event queue

Constructor Detail

ActiveValueSortedMap

public ActiveValueSortedMap()
Creates new ActiveValueSortedMap


ActiveValueSortedMap

public ActiveValueSortedMap(java.util.Map map)
Create a new AVSM from the given map.

Parameters:
map -
Method Detail

addVSMEventListener

public void addVSMEventListener(VSMEventListener el)
ad a new event listener


fireEvent

public void fireEvent(VSMEvent e)
issue the event named


put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Puts an object into the map and fires the event.

Specified by:
put in interface java.util.Map
Overrides:
put in class ValueSortedMap
Parameters:
key -
value -

remove

public java.lang.Object remove(java.lang.Object key)
Removes an object from the event and fires the event.

Specified by:
remove in interface java.util.Map
Overrides:
remove in class ValueSortedMap
Parameters:
key -

update

public java.lang.Object update(java.lang.Object key,
                               java.lang.Object value)

update

public java.lang.Object update(java.lang.Object key,
                               double value)

putAll

public void putAll(java.util.Map map)
Puts all the objects into the map and fires the event.

Specified by:
putAll in interface java.util.Map
Overrides:
putAll in class ValueSortedMap
Parameters:
map -

clear

public void clear()
Removes all items from the map and fires an event.

Specified by:
clear in interface java.util.Map
Overrides:
clear in class ValueSortedMap