org.webmacro.util
Class SharedReference

java.lang.Object
  extended byorg.webmacro.util.SharedReference
All Implemented Interfaces:
java.lang.Cloneable

public final class SharedReference
extends java.lang.Object
implements java.lang.Cloneable

Share an object with minimal synchronization


Constructor Summary
SharedReference(java.lang.Object o)
          Create a new SoftReference to o and wrap it in a SharedReference
 
Method Summary
 java.lang.Object clone()
          Make a copy for another thread
 boolean equals(java.lang.Object o)
           
 java.lang.Object get()
          This method must be called by only a single thread.
 int hashCode()
           
static void main(java.lang.String[] arg)
           
 void set(java.lang.Object o)
          This method must be called by only a single thread.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SharedReference

public SharedReference(java.lang.Object o)
Create a new SoftReference to o and wrap it in a SharedReference

Method Detail

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

toString

public java.lang.String toString()

get

public java.lang.Object get()
This method must be called by only a single thread. Get a copy of the Object.


set

public void set(java.lang.Object o)
This method must be called by only a single thread. Set the value of the Object.


clone

public java.lang.Object clone()
Make a copy for another thread


main

public static void main(java.lang.String[] arg)