Class MetroIIEventBuilder


  • public class MetroIIEventBuilder
    extends java.lang.Object
    MetroEventBuilder is a set of routines that create Metro events.
    Since:
    Ptolemy II 11.0
    Version:
    $Id$
    Author:
    Liangpeng Guo
    Pt.AcceptedRating:
    Red (glp)
    Pt.ProposedRating:
    Red (glp)
    • Constructor Detail

      • MetroIIEventBuilder

        public MetroIIEventBuilder()
        Constructs an event builder.
    • Method Detail

      • newProposedEvent

        public static metroIIcomm.Event.Builder newProposedEvent​(java.lang.String eventName,
                                                                 long timeValue,
                                                                 double resolution)
        Creates a proposed Metro event.
        Parameters:
        eventName - The name of the event
        timeValue - The time value of the event
        resolution - The resolution associated with the time value
        Returns:
        A Metro event with the given name and the time tag
      • newProposedEvent

        public static metroIIcomm.Event.Builder newProposedEvent​(java.lang.String eventName)
        Creates a proposed Metro event.
        Parameters:
        eventName - The name of the event
        Returns:
        A Metro event with the given name
      • trimModelName

        public static java.lang.String trimModelName​(java.lang.String name)
        Trims the substring from the beginning to the first delimiter '.' from a given string. Example: XXX.YYY.ZZZ -> YYY.ZZZ
        Parameters:
        name - The input string
        Returns:
        The trimmed string
      • atLeastOneNotified

        public static boolean atLeastOneNotified​(java.lang.Iterable<metroIIcomm.Event.Builder> events)
        Checks if at least one event is notified in the event vector.
        Parameters:
        events - event vector to be checked.
        Returns:
        true if there is at least one event notified.