jSyncManager

org.jSyncManager.JSerial.TestSuite
Class DataObject

java.lang.Object
  extended byorg.jSyncManager.JSerial.TestSuite.DataObject
All Implemented Interfaces:
java.io.Serializable

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

A class to represent a piece of data to be passed between hosts. This class is designed to be a demonstration of one of the potential uses for the SerialInterface class. In this demonstration, an object of the Data Object class is passed back and forth between two or more hosts, with each host adding itself to the pass list with a date/timestame, and by incrementing a counter.

Version:
1.0
Author:
Brad Barclay.
See Also:
Serialized Form

Constructor Summary
DataObject(int passLimit)
          The DataObject constructor.
 
Method Summary
 int getCounter()
          This method returns the current value of the counter.
 StampObject getLastTimeStamp()
          A method for retrieving the last Date/Timestamp object.
 int getPassLimit()
          This method returns the limit to the number of times this object should be passed.
 void updateObject(java.lang.String hostName)
          A method for preparing this object for sending to the next host.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataObject

public DataObject(int passLimit)
The DataObject constructor. This constructor simply stores a new StampObject and initializes the starting speed.

Parameters:
passLimit - the maximum number of times to pass this object between hosts.
Method Detail

getCounter

public int getCounter()
This method returns the current value of the counter.

Returns:
int the current counter value.

getLastTimeStamp

public StampObject getLastTimeStamp()
A method for retrieving the last Date/Timestamp object.

Returns:
the last received date/timestamp object.

getPassLimit

public int getPassLimit()
This method returns the limit to the number of times this object should be passed.

Returns:
int the pass limit for this object.

updateObject

public void updateObject(java.lang.String hostName)
                  throws java.lang.IndexOutOfBoundsException
A method for preparing this object for sending to the next host. This method adds a new StampObject to the queue, and increments the counter, in preparation of being passed to the next host.

Throws:
java.lang.IndexOutOfBoundsException - thrown if we've gone beyond the maximum pass limit.

jSyncManager

Copyright (c) 1998 - 2003 Brad BARCLAY and others. All Rights Reserved.