com.moesol.ref
Class AssertNoReference

java.lang.Object
  extended by java.lang.ref.Reference
      extended by java.lang.ref.WeakReference
          extended by com.moesol.ref.AssertNoReference

public class AssertNoReference
extends WeakReference

Allow assertions to be made about strong object references.

 Object test_object = new Object();
 AssertNoReference ref_check = new AssertNoReference(test_object);
 // use test_object
 test_object = null;
 assert(!ref_check.isReferenced());
 


Constructor Summary
AssertNoReference(Object referent)
           
 
Method Summary
 boolean isReferenced()
           
 
Methods inherited from class java.lang.ref.Reference
clear, enqueue, get, isEnqueued
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssertNoReference

public AssertNoReference(Object referent)
Method Detail

isReferenced

public boolean isReferenced()
Returns:
true if there are strong references to referent.


Copyright © 2004 Moebius Solutions, Inc. All Rights Reserved.