Class EventBasedTimestampWeightedTally

    • Constructor Detail

      • EventBasedTimestampWeightedTally

        public EventBasedTimestampWeightedTally​(String description)
        constructs a new EventBasedTimestampWeightedTally with a description.
        Parameters:
        description - String; the description of this EventBasedTimestampWeightedTally
      • EventBasedTimestampWeightedTally

        public EventBasedTimestampWeightedTally​(String description,
                                                EventProducer eventProducer)
        Construct a new EventBasedTimestampWeightedTally with a description.
        Parameters:
        description - String; the description of this WeightedTally
        eventProducer - EventProducer; the EventProducer to embed and use in this statistic
    • Method Detail

      • register

        public double register​(Calendar timestamp,
                               double value)
        Process one observed Calender-based value. The time used will be the Calendar's time in milliseconds. Silently ignore when a value is registered, but tally is not active, i.e. when endObservations() has been called.
        Overrides:
        register in class TimestampWeightedTally
        Parameters:
        timestamp - Calendar; the Calendar object representing the timestamp
        value - double; the value to process
        Returns:
        double; the value
        Throws:
        NullPointerException - when timestamp is null
        IllegalArgumentException - when value is NaN
        IllegalArgumentException - when given timestamp is before last timestamp
      • register

        public double register​(Number timestamp,
                               double value)
        Process one observed Number-based value. Silently ignore when a value is registered, but tally is not active, i.e. when endObservations() has been called.
        Overrides:
        register in class TimestampWeightedTally
        Parameters:
        timestamp - Number; the object representing the timestamp
        value - double; the value to process
        Returns:
        double; the value
        Throws:
        NullPointerException - when timestamp is null
        IllegalArgumentException - when value is NaN or timestamp is NaN
        IllegalArgumentException - when given timestamp is before last timestamp
      • register

        public double register​(double timestamp,
                               double value)
        Explicit;y override the double value method signature of WeightedTally to call the right method.
        Process one observed double value. Silently ignore when a value is registered, but tally is not active, i.e. when endObservations() has been called.
        Overrides:
        register in class TimestampWeightedTally
        Parameters:
        timestamp - Number; the object representing the timestamp
        value - double; the value to process
        Returns:
        double; the value
        Throws:
        NullPointerException - when timestamp is null
        IllegalArgumentException - when value is NaN or timestamp is NaN
        IllegalArgumentException - when given timestamp is before last timestamp
      • fireEvents

        protected <T extends Serializable & Comparable<T>> void fireEvents​(Serializable timestamp)
                                                                    throws RemoteException
        Method that can be overridden to fire own events or additional events when registering an observation.
        Type Parameters:
        T - a type for the timestamp that is Serializable and Comparable
        Parameters:
        timestamp - T; the timestamp to use in the TimedEvents
        Throws:
        RemoteException - on network error