Class AbstractMessage<A>

java.lang.Object
org.simplesim.core.messaging.AbstractMessage<A>
Type Parameters:
A - type of addressing
Direct Known Subclasses:
Message, RoutingMessage

public class AbstractMessage<A> extends Object
Abstract base class for messages that are sent from one port to another.

Messages always contain a content and may be extended with additional features. If agents are connected directly, the destination can be omitted and set to null.

Note: This class is immutable and thus thread-safe.

See Also:
  • Constructor Details

    • AbstractMessage

      public AbstractMessage(A s, A d, Object c)
      Generals constructor for all types of messages.

      Note: This class is read-only and thus thread-safe

      Parameters:
      s - source of message
      d - destination of message
      c - the content
  • Method Details

    • getSource

      public final A getSource()
    • getDestination

      public final A getDestination()
    • getContent

      public final <C> C getContent()