edu.ksu.cis.projects.bogor.util
Class Wrapper<E>
java.lang.Object
edu.ksu.cis.projects.bogor.util.Wrapper<E>
public final class Wrapper<E>
- extends Object
Convenience class used to host a re-assignable reference. This is useful
primarily when one wants to update a local variable from within an anonymous
class's method body. E.g.,
public void foo() throws InterruptedException
{
final Wrapper<String> wr = new Wrapper<String>("foo");
Thread t = new Thread(new Runnable()
{
public void run()
{
wr.element = "bar";
}
});
t.start();
t.join();
}
- Version:
- CVS $Revision: 1.1 $ $Date: 2005/01/24 23:18:17 $
- Author:
- Matt Hoosier
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
element
public E element
Wrapper
public Wrapper(E elem)
Wrapper
public Wrapper()