vooga.network.data
Class DataObject
java.lang.Object
vooga.network.data.DataObject
- All Implemented Interfaces:
- java.io.Serializable
public class DataObject
- extends java.lang.Object
- implements java.io.Serializable
The DataObject class is a wrapper for objects stored in DataManagers,
containing a time stamp and allowing for synchronization between local and
network storage.
- Author:
- tanner schmidt
- See Also:
- Serialized Form
Constructor Summary |
DataObject()
|
DataObject(java.lang.Object data)
Creates a data object that wraps the given Object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DataObject
public DataObject()
DataObject
public DataObject(java.lang.Object data)
- Creates a data object that wraps the given Object. The time stamp is set
to the current time.
- Parameters:
data
-
getObject
public java.lang.Object getObject()
- Returns:
- The Object wrapped by this
DataObject
.
synchronize
protected DataObject synchronize(DataObject other)
- Synchronizes this
DataObject
with another. The method
compares the time stamps and returns a DataObject that contains the most
recent data.
- Parameters:
other
- The DataObject
to synchronize with.
- Returns:
- The most recent
DataObject
.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object