org.webmacro.util
Class SharedObject

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

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

Share an object with minimal synchronization


Constructor Summary
SharedObject(java.lang.Object o)
           
 
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

SharedObject

public SharedObject(java.lang.Object o)
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)