edu.berkeley.guir.ptk.data
Class DataObject

java.lang.Object
  extended byedu.berkeley.guir.ptk.data.Data
      extended byedu.berkeley.guir.ptk.data.DataObject
All Implemented Interfaces:
java.io.Serializable

public class DataObject
extends Data

Contains data as a Object. It inherits an id field, which is set by the creator of the object and indentifies it.

Author:
tmatthew
See Also:
Serialized Form

Field Summary
 java.lang.Object data
          The Object data for this object.
 
Fields inherited from class edu.berkeley.guir.ptk.data.Data
id
 
Constructor Summary
DataObject(java.lang.Object data)
           
DataObject(java.lang.Object data, java.lang.String id)
          Constructor.
 
Method Summary
 Data copy()
          Returns a copy if this Data object.
 boolean dataEquals(Data n)
          Compares the data fields of this Data and the given Data for equality.
 boolean equals(Data n)
          Compares this Data and the given Data for equality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

public java.lang.Object data
The Object data for this object.

Constructor Detail

DataObject

public DataObject(java.lang.Object data,
                  java.lang.String id)
Constructor.

Parameters:
data - the Object data for this object
id - indentifies this data object Some example String ids: "location," "name," "forecast." Some data ids are already specified in PTKConstants

DataObject

public DataObject(java.lang.Object data)
Method Detail

equals

public boolean equals(Data n)
Compares this Data and the given Data for equality.

Specified by:
equals in class Data
Parameters:
n -
Returns:
boolean true if the given Data has the same data and id as this Data

dataEquals

public boolean dataEquals(Data n)
Compares the data fields of this Data and the given Data for equality.

Specified by:
dataEquals in class Data
Returns:
boolean true if the given Data has the same data as this Data

copy

public Data copy()
Description copied from class: Data
Returns a copy if this Data object.

Specified by:
copy in class Data
Returns: