org.openflow.util
Class RefTrack<REF_TO,REF_FROM>

java.lang.Object
  extended by org.openflow.util.RefTrack<REF_TO,REF_FROM>

public class RefTrack<REF_TO,REF_FROM>
extends java.lang.Object

Tracks which objects refer to some object.


Field Summary
 REF_TO obj
          the object being tracked
 
Constructor Summary
RefTrack(REF_TO objToTrack, REF_FROM ref)
          Construct a RefTrack with one object referring to another.
 
Method Summary
 void addRef(REF_FROM o)
          Adds a reference to obj
 boolean removeRef(REF_FROM o)
          Removes the reference o and returns true if obj no longer has any references to it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

obj

public final REF_TO obj
the object being tracked

Constructor Detail

RefTrack

public RefTrack(REF_TO objToTrack,
                REF_FROM ref)
Construct a RefTrack with one object referring to another.

Parameters:
objToTrack - the object whose referants are being tracked
ref - an object which refers to objToTrack
Method Detail

addRef

public void addRef(REF_FROM o)
Adds a reference to obj


removeRef

public boolean removeRef(REF_FROM o)
Removes the reference o and returns true if obj no longer has any references to it.