Class Protocol

java.lang.Object
model.estrutura.Protocol

public class Protocol extends Object
Represents a protocol node in a doubly linked list structure with an embedded FIFO data queue. Each protocol node contains type information, data, and maintains a FIFO data list for additional data storage and processing.

This class is designed for protocol management systems where each protocol can have its own queue of data packets or messages.

Since:
2024
  • Field Details

    • type

      private String type
    • data

      private String data
    • nextProtocol

      private Protocol nextProtocol
    • previousProtocol

      private Protocol previousProtocol
    • dataList

      private DataList dataList
  • Constructor Details

    • Protocol

      public Protocol(String type, String data)
      Constructs a new Protocol node with the specified type and data. Initializes next and previous protocol references to null and creates an empty FIFO data list for additional data storage.
      Parameters:
      type - the protocol type identifier
      data - the primary data associated with this protocol
  • Method Details

    • getType

      public String getType()
      Returns the protocol type identifier.
      Returns:
      the protocol type
    • setType

      public void setType(String type)
      Sets the protocol type identifier.
      Parameters:
      type - the new protocol type
    • getData

      public String getData()
      Returns the primary data associated with this protocol.
      Returns:
      the primary data
    • setData

      public void setData(String data)
      Sets the primary data for this protocol.
      Parameters:
      data - the new primary data
    • getNextProtocol

      public Protocol getNextProtocol()
      Returns the next protocol node in the sequence.
      Returns:
      the next protocol node, or null if this is the last node
    • setNextProtocol

      public void setNextProtocol(Protocol nextProtocol)
      Sets the reference to the next protocol node in the sequence.
      Parameters:
      nextProtocol - the next protocol node, or null to make this the last node
    • getPreviousProtocol

      public Protocol getPreviousProtocol()
      Returns the previous protocol node in the sequence.
      Returns:
      the previous protocol node, or null if this is the first node
    • setPreviousProtocol

      public void setPreviousProtocol(Protocol previousProtocol)
      Sets the reference to the previous protocol node in the sequence.
      Parameters:
      previousProtocol - the previous protocol node, or null to make this the first node
    • getDataList

      public DataList getDataList()
      Returns the FIFO data list associated with this protocol. This list can be used to store additional data packets or messages in first-in-first-out order.
      Returns:
      the DataList instance for this protocol
    • toString

      public String toString()
      Returns a string representation of this protocol node. The format is the concatenation of type and data.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this protocol node