Class NetMessage

java.lang.Object
QueueNet.NetMessage
All Implemented Interfaces:
Cloneable

public class NetMessage extends Object implements Cloneable
This class implements a message which could be received for example by a NetNode or by a NodeSection.
Author:
Francesco Radaelli
  • Constructor Details

    • NetMessage

      public NetMessage()
      Creates a new instance of NetMessage setting all the field to default values.
  • Method Details

    • setEvent

      public void setEvent(int event)
      Sets the event field of the NetMessage.
      Parameters:
      event - Value of property event.
    • getEvent

      public int getEvent()
      Gets the event field of the NetMessage.
      Returns:
      Value of property event.
    • setSourceSection

      public void setSourceSection(byte sourceSection)
      Sets the Source Section field of the NetMessage.
      Parameters:
      sourceSection - Value of property Source Section.
    • getSourceSection

      public byte getSourceSection()
      Gets the Source Section field of the NetMessage.
      Returns:
      Value of property Source Section.
    • setDestinationSection

      public void setDestinationSection(byte destinationSection)
      Sets the Destination Section field of the NetMessage.
      Parameters:
      destinationSection - Value of property Destination Section.
    • getDestinationSection

      public byte getDestinationSection()
      Gets the Destination Section field of the NetMessage.
      Returns:
      Value of property Destination Section.
    • setData

      public void setData(Object data)
      Sets the data field of the NetMessage.
      Parameters:
      data - Value of property data.
    • getData

      public Object getData()
      Gets the data field of the NetMessage.
      Returns:
      Value of property data.
    • getJob

      public Job getJob()
      Returns the job attached to message if the event is a JOB_EVENT or ACK_EVENT, otherwise returns null.
      Returns:
      The job of the NetMessage.
    • setTime

      public void setTime(double time)
      Sets the time field of the NetMessage.
      Parameters:
      time - Value of property time.
    • getTime

      public double getTime()
      Gets the time field of the NetMessage.
      Returns:
      Value of property time.
    • setSource

      public void setSource(NetNode source)
      Sets the source field of the NetMessage.
      Parameters:
      source - Value of property source.
    • getSource

      public NetNode getSource()
      Gets the Source field of the NetMessage.
      Returns:
      Value of property Source.
    • setDestination

      public void setDestination(NetNode destination)
      Sets the destination field of the NetMessage.
      Parameters:
      destination - Value of property destination .
    • getDestination

      public NetNode getDestination()
      Gets the Destination field of the NetMessage.
      Returns:
      Value of property Destination .
    • sentBy

      public boolean sentBy(byte section, NetNode node)
    • clone

      public Object clone()
      Overrides:
      clone in class Object