org.lwes.listener
Class DatagramQueueElement

java.lang.Object
  extended by org.lwes.listener.DatagramQueueElement
All Implemented Interfaces:
QueueElement

public class DatagramQueueElement
extends java.lang.Object
implements QueueElement

Element objects to use in the threaded queueing system. This encapsulates datagrams and timestamps.

Author:
Michael P. Lum

Constructor Summary
DatagramQueueElement()
          Default constructor.
 
Method Summary
 void clear()
          Resets this packet to null
 boolean equals(DatagramQueueElement element)
          Determine equality with another DatagramQueueElement
 boolean equals(java.lang.Object object)
          Determine equality with an object
 java.net.DatagramPacket getPacket()
          Gets the datagram packet payload.
 long getTimestamp()
          Gets the timestamp associated with this packet
 void setPacket(java.net.DatagramPacket packet)
          Sets the datagram packet payload
 void setTimestamp(long timestamp)
          Sets the timestamp associated with this packet
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatagramQueueElement

public DatagramQueueElement()
Default constructor.

Method Detail

getPacket

public java.net.DatagramPacket getPacket()
Gets the datagram packet payload.

Returns:
the DatagramPacket

setPacket

public void setPacket(java.net.DatagramPacket packet)
Sets the datagram packet payload

Parameters:
packet - the DatagramPacket

getTimestamp

public long getTimestamp()
Gets the timestamp associated with this packet

Specified by:
getTimestamp in interface QueueElement
Returns:
the timestamp

setTimestamp

public void setTimestamp(long timestamp)
Sets the timestamp associated with this packet

Specified by:
setTimestamp in interface QueueElement
Parameters:
timestamp - the timestamp

clear

public void clear()
Resets this packet to null


equals

public boolean equals(java.lang.Object object)
Determine equality with an object

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to compare with
Returns:
true if the object is equal to this one, false if not

equals

public boolean equals(DatagramQueueElement element)
Determine equality with another DatagramQueueElement

Parameters:
element - the object to compare with
Returns:
true if the object is equal to this one, false if not