org.sourceforge.jemm.util
Class ContextStack

java.lang.Object
  extended by org.sourceforge.jemm.util.ContextStack

public final class ContextStack
extends java.lang.Object

Utility class to track newly constructed object references.

Author:
Rory Graves, Paul Keeble

Method Summary
static void clearObject(java.lang.Object obj)
          Removes all instances of the object from the top of the stack.
static void clearReferences()
           
static int countReferences()
          Counts the number of references remaining and returns the count.
static boolean hasLastReference()
          If only one reference remains then it is the last reference.
static java.lang.Object peekReference()
           
static java.lang.Object popReference()
          Return the last constructed reference pushed onto the constructor stack.
static void pushReference(java.lang.Object ref)
          Push a constructor reference onto the constructor stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

pushReference

public static void pushReference(java.lang.Object ref)
Push a constructor reference onto the constructor stack.

Parameters:
ref - The constructed item reference.

popReference

public static java.lang.Object popReference()
Return the last constructed reference pushed onto the constructor stack.

Returns:
The last reference pushed onto the constructor stack.

peekReference

public static java.lang.Object peekReference()

clearObject

public static void clearObject(java.lang.Object obj)
Removes all instances of the object from the top of the stack.


countReferences

public static int countReferences()
Counts the number of references remaining and returns the count.

Returns:

clearReferences

public static void clearReferences()

hasLastReference

public static boolean hasLastReference()
If only one reference remains then it is the last reference.

Returns:


Copyright © 2009. All Rights Reserved.