com.jme.util.export
Class ListenableStringFloatMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,V>
          extended by com.jme.util.export.AbstractStringKeyMap<java.lang.Float>
              extended by com.jme.util.export.StringFloatMap
                  extended by com.jme.util.export.ListenableStringFloatMap
All Implemented Interfaces:
Savable, java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Float>

public class ListenableStringFloatMap
extends StringFloatMap

A StringFloatMap which can be listened to in order to get notification when specified values in the map are modified.

See Also:
Serialized Form

Nested Class Summary
static interface ListenableStringFloatMap.FloatListener
           
 
Field Summary
protected  java.util.Map<java.lang.String,java.util.Set<ListenableStringFloatMap.FloatListener>> changeListeners
           
(package private) static long serialVersionUID
           
 
Fields inherited from class com.jme.util.export.AbstractStringKeyMap
unsavedKeys
 
Constructor Summary
ListenableStringFloatMap()
           
ListenableStringFloatMap(int initialCapacity)
           
ListenableStringFloatMap(int initialCapacity, float loadFactor)
           
ListenableStringFloatMap(java.util.Map<? extends java.lang.String,? extends java.lang.Float> m)
           
 
Method Summary
 void addListener(ListenableStringFloatMap.FloatListener changeListener, java.util.Collection<java.lang.String> keys)
          IMPORTANT: MAKE SURE TO CALL removeListener() WHEN YOU ARE FINISHED.
 void clear()
           
protected  void cullListenerSets()
           
 int getListenerCount()
           
protected  java.util.Set<ListenableStringFloatMap.FloatListener> getListeners()
           
 java.lang.String listenerReport()
           
protected  void notifyAbout(java.util.Collection<? extends java.lang.String> keys)
           
protected  void notifyListener(ListenableStringFloatMap.FloatListener listener)
           
 java.lang.Float put(java.lang.String key, java.lang.Float f)
           
 void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Float> newMappings)
          IMPORTANT: This method will notify the caller if the caller is listening.
 java.lang.Float remove(java.lang.Object key)
           
 void removeListener(ListenableStringFloatMap.FloatListener changeListener)
           
 
Methods inherited from class com.jme.util.export.StringFloatMap
read, write
 
Methods inherited from class com.jme.util.export.AbstractStringKeyMap
getClassTag
 
Methods inherited from class java.util.HashMap
clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

changeListeners

protected java.util.Map<java.lang.String,java.util.Set<ListenableStringFloatMap.FloatListener>> changeListeners
Constructor Detail

ListenableStringFloatMap

public ListenableStringFloatMap()

ListenableStringFloatMap

public ListenableStringFloatMap(int initialCapacity)

ListenableStringFloatMap

public ListenableStringFloatMap(int initialCapacity,
                                float loadFactor)

ListenableStringFloatMap

public ListenableStringFloatMap(java.util.Map<? extends java.lang.String,? extends java.lang.Float> m)
Method Detail

listenerReport

public java.lang.String listenerReport()

addListener

public void addListener(ListenableStringFloatMap.FloatListener changeListener,
                        java.util.Collection<java.lang.String> keys)
IMPORTANT: MAKE SURE TO CALL removeListener() WHEN YOU ARE FINISHED. Otherwise you will cause a memory leak when your instance is not garbage collected.


removeListener

public void removeListener(ListenableStringFloatMap.FloatListener changeListener)

cullListenerSets

protected void cullListenerSets()

getListeners

protected java.util.Set<ListenableStringFloatMap.FloatListener> getListeners()

getListenerCount

public int getListenerCount()

clear

public void clear()
Specified by:
clear in interface java.util.Map<java.lang.String,java.lang.Float>
Overrides:
clear in class java.util.HashMap<java.lang.String,java.lang.Float>

notifyListener

protected void notifyListener(ListenableStringFloatMap.FloatListener listener)

putAll

public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Float> newMappings)
IMPORTANT: This method will notify the caller if the caller is listening. If you don't want that, then wrap your putAll() call inside of removeListener and addListener calls.

Specified by:
putAll in interface java.util.Map<java.lang.String,java.lang.Float>
Overrides:
putAll in class java.util.HashMap<java.lang.String,java.lang.Float>

notifyAbout

protected void notifyAbout(java.util.Collection<? extends java.lang.String> keys)

put

public java.lang.Float put(java.lang.String key,
                           java.lang.Float f)
Specified by:
put in interface java.util.Map<java.lang.String,java.lang.Float>
Overrides:
put in class java.util.HashMap<java.lang.String,java.lang.Float>

remove

public java.lang.Float remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map<java.lang.String,java.lang.Float>
Overrides:
remove in class java.util.HashMap<java.lang.String,java.lang.Float>


Copyright 2003-2009 jMonkeyEngine