Class Event

  • All Implemented Interfaces:
    Serializable, EventInterface

    public class Event
    extends AbstractEvent
    The Event class forms the reference implementation for the EventInterface. Because events are often sent over the network, the interface demands that source of the event and its content are serializable. It is the responsibility of the programmer, though, that the fields of the sourceId and content are serializable as well.

    Copyright (c) 2002-2021 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html. This class was originally part of the DSOL project, see https://simulation.tudelft.nl/dsol/manual.

    Author:
    Alexander Verbraeck
    See Also:
    Serialized Form
    • Constructor Detail

      • Event

        public Event​(EventTypeInterface type,
                     Serializable sourceId,
                     Serializable content)
        Construct a new Event, where compliance with the metadata is verified.
        Parameters:
        type - EventTypeInterface; the name of the Event.
        sourceId - Serializable; the source id of the sender
        content - Serializable; the content of the event
      • Event

        public Event​(EventTypeInterface type,
                     Serializable sourceId,
                     Serializable content,
                     boolean verifyMetaData)
        Construct a new Event, with a choice to verify compliance with metadata.
        Parameters:
        type - EventTypeInterface; the name of the Event.
        sourceId - Serializable; the source id of the sender
        content - Serializable; the content of the event
        verifyMetaData - boolean; whether to verify the compliance with metadata or not