com.isti.quakewatch.message
Class QWDynMsgNumTimeRec

java.lang.Object
  extended by com.isti.quakewatch.message.QWDynMsgNumTimeRec
All Implemented Interfaces:
QWMsgNumTimeRec

public class QWDynMsgNumTimeRec
extends java.lang.Object
implements QWMsgNumTimeRec

Class QWDynMsgNumTimeRec defines a dynamic message record holding message-record and time-generated values.


Constructor Summary
QWDynMsgNumTimeRec()
          Creates a dynamic message record holding message-record and time-generated values.
QWDynMsgNumTimeRec(long msgNum, long timeGenerated)
          Creates a dynamic message record holding message-record and time-generated values.
QWDynMsgNumTimeRec(long msgNum, long timeGenerated, java.lang.Object msgRecordSyncObject)
          Creates a dynamic message record holding message-record and time-generated values.
QWDynMsgNumTimeRec(java.lang.Object msgRecordSyncObject)
          Creates a dynamic message record holding message-record and time-generated values.
 
Method Summary
 long getMsgNum()
          Returns the message number value.
 QWStaticMsgNumTimeRec getMsgNumAndTime()
          Returns the current message-number and time-generated values.
 QWStaticMsgNumTimeRec getMsgNumAndTime(QWStaticMsgNumTimeRec recObj)
          Returns the current message-number and time-generated values.
 java.lang.Object getMsgRecordSyncObject()
          Returns the thread-synchronization object in use.
 long getTimeGenerated()
          Returns the time-generated value.
 void incMsgNumAndSetTime(long timeGenerated)
          Increments the current message number and sets the time-generated value.
 void setMsgNumAndTime(long msgNum, long timeGenerated)
          Enters the given message-number and time-generated values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QWDynMsgNumTimeRec

public QWDynMsgNumTimeRec(long msgNum,
                          long timeGenerated,
                          java.lang.Object msgRecordSyncObject)
Creates a dynamic message record holding message-record and time-generated values.

Parameters:
msgNum - the message number to use.
timeGenerated - the time-generated value to use (ms since 1/1/1970).
msgRecordSyncObject - the thread-synchronization object to use, or null to create a new one.

QWDynMsgNumTimeRec

public QWDynMsgNumTimeRec(long msgNum,
                          long timeGenerated)
Creates a dynamic message record holding message-record and time-generated values.

Parameters:
msgNum - the message number to use.
timeGenerated - the time-generated value to use (ms since 1/1/1970).

QWDynMsgNumTimeRec

public QWDynMsgNumTimeRec(java.lang.Object msgRecordSyncObject)
Creates a dynamic message record holding message-record and time-generated values.

Parameters:
msgRecordSyncObject - the thread-synchronization object to use, or null to create a new one.

QWDynMsgNumTimeRec

public QWDynMsgNumTimeRec()
Creates a dynamic message record holding message-record and time-generated values.

Method Detail

setMsgNumAndTime

public void setMsgNumAndTime(long msgNum,
                             long timeGenerated)
Enters the given message-number and time-generated values.

Parameters:
msgNum - the message number to use.
timeGenerated - the time-generated value to use (ms since 1/1/1970).

incMsgNumAndSetTime

public void incMsgNumAndSetTime(long timeGenerated)
Increments the current message number and sets the time-generated value.

Parameters:
timeGenerated - the time-generated value to use (ms since 1/1/1970).

getMsgNum

public long getMsgNum()
Returns the message number value. This method is needed to implemented the 'QWMsgNumTimeRec' interface.

Specified by:
getMsgNum in interface QWMsgNumTimeRec
Returns:
The message number value.

getTimeGenerated

public long getTimeGenerated()
Returns the time-generated value. This method is needed to implemented the 'QWMsgNumTimeRec' interface.

Specified by:
getTimeGenerated in interface QWMsgNumTimeRec
Returns:
The time-generated value, in milliseconds since 1/1/1970.

getMsgRecordSyncObject

public java.lang.Object getMsgRecordSyncObject()
Returns the thread-synchronization object in use.

Returns:
The thread-synchronization object in use.

getMsgNumAndTime

public QWStaticMsgNumTimeRec getMsgNumAndTime(QWStaticMsgNumTimeRec recObj)
Returns the current message-number and time-generated values.

Parameters:
recObj - a message record to compare message-number and time- generated values against (same object returned if equal), or null for none.
Returns:
A 'QWStaticMsgNumTimeRec' object containing the current message-number and time-generated values.

getMsgNumAndTime

public QWStaticMsgNumTimeRec getMsgNumAndTime()
Returns the current message-number and time-generated values.

Returns:
A 'QWStaticMsgNumTimeRec' object containing the current message-number and time-generated values.