org.eclipse.emf.ecp.view.test.common
Class GCCollectable

java.lang.Object
  extended by org.eclipse.emf.ecp.view.test.common.GCCollectable

public class GCCollectable
extends Object

Convenience class for expecting objects to be garbage collected. Because GC is non-deterministic there's no time constrained guarantee, when isCollectable returns true.

Author:
emueller

Constructor Summary
GCCollectable(Object obj)
          Constructor.
 
Method Summary
 PhantomReference<Object> getPhantomRef()
           
 ReferenceQueue<Object> getQueue()
           
 boolean isCollectable()
          Checks whether the the object contained by the GCCollectable may be finalized.
 boolean isResult()
           
 void setResult(boolean result)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GCCollectable

public GCCollectable(Object obj)
Constructor.

Parameters:
obj - the object that is supposed to be finalized
Method Detail

isCollectable

public boolean isCollectable()
Checks whether the the object contained by the GCCollectable may be finalized.

Returns:
true, if the contained object may be finalized, false otherwise

getQueue

public ReferenceQueue<Object> getQueue()

isResult

public boolean isResult()

setResult

public void setResult(boolean result)

getPhantomRef

public PhantomReference<Object> getPhantomRef()


Copyright © 2014. All Rights Reserved.