|
GraphLab Project | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgraphlab.platform.attribute.TimeLimitedNotifiableAttrSet<T>
public class TimeLimitedNotifiableAttrSet<T extends AttributeSet>
A handy NotifiableSet which acts on any AttributeSet and converts it to a NotifiableAttributeSet, This is done by checking the AttributeSet for changes in each (100) mili seconds. changes on (T) input will take effect on next 100 milisecond, using this class should be done with care, this class uses a thread and checks the edge on each 100ms for any changes, so creating a lot of instances of this class (for example for all edges of graph) will take more and more cpu,
try to create as few as possible instances of this class and call stop() when you don't need it any more!
Constructor Summary | |
---|---|
TimeLimitedNotifiableAttrSet(T input)
|
Method Summary | |
---|---|
void |
addAttributeListener(AttributeListener attributeListener)
Add a listener to changes of an AttributeSet. |
void |
fireAttributeChange(java.util.Collection<AttributeListener> listeners,
java.lang.String name,
java.lang.Object oldVal,
java.lang.Object newVal)
|
java.lang.Object |
get(java.lang.String name)
|
java.util.Collection<AttributeListener> |
getAttributeListeners()
|
java.util.Map<java.lang.String,java.lang.Object> |
getAttrs()
|
void |
put(java.lang.String name,
java.lang.Object value)
|
void |
removeAttributeListener(AttributeListener attributeListener)
Remove a listener from list of listeners. |
void |
run()
-> Thread |
void |
start()
starts firinig listeners to this class |
void |
stop()
stops firing listeners |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimeLimitedNotifiableAttrSet(T input)
Method Detail |
---|
public void start()
public void stop()
public void run()
run
in interface java.lang.Runnable
public java.util.Map<java.lang.String,java.lang.Object> getAttrs()
getAttrs
in interface AttributeSet
public void put(java.lang.String name, java.lang.Object value)
put
in interface AttributeSet
public java.lang.Object get(java.lang.String name)
get
in interface AttributeSet
public void addAttributeListener(AttributeListener attributeListener)
NotifiableAttributeSet
List
because of
getAttributeListeners()
method.
addAttributeListener
in interface NotifiableAttributeSet
attributeListener
- the listener!public java.util.Collection<AttributeListener> getAttributeListeners()
getAttributeListeners
in interface NotifiableAttributeSet
public void removeAttributeListener(AttributeListener attributeListener)
NotifiableAttributeSet
removeAttributeListener
in interface NotifiableAttributeSet
public void fireAttributeChange(java.util.Collection<AttributeListener> listeners, java.lang.String name, java.lang.Object oldVal, java.lang.Object newVal)
|
GraphLab Project | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |