com.ibm.tspaces.examples.simple
Class Example4Obj

java.lang.Object
  |
  +--com.ibm.tspaces.examples.simple.Example4Obj

public class Example4Obj
extends java.lang.Object
implements java.io.Serializable

This class is just a dummy Userdefined Class It must implenemt Serializable or Externalizable

Author:
John Thomas
See Also:
Serializable, Externalizable, Serialized Form

Constructor Summary
Example4Obj()
          Default public constructor is required if you implement Externalizable
Example4Obj(java.lang.String data)
          Constructor with string specified
 
Method Summary
 boolean equals(java.lang.Object other)
          An equals method is needed if you are going to do any searching of TupleSpace for Tuples that have a match on the user object.
 java.lang.String getData()
          This method will return the data object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Example4Obj

public Example4Obj()
Default public constructor is required if you implement Externalizable

Example4Obj

public Example4Obj(java.lang.String data)
Constructor with string specified
Method Detail

getData

public java.lang.String getData()
This method will return the data object.

equals

public boolean equals(java.lang.Object other)
An equals method is needed if you are going to do any searching of TupleSpace for Tuples that have a match on the user object. The default Object.equals(Object 0) returns true only on for byte by byte equality which may not make sense for objects that consist of multiple data fields The following equals method determines equality by comparing the "userdata" field. The point is that for User objects, the equality is determined by the purpose and use of the object not by any predetermined Java specification. Note that it is important to protect against NullPointerExceptions
Overrides:
equals in class java.lang.Object
Parameters:
other - The value from the corresponding Field in the Tuple that we are comparing against.