Class Correlation<T>

java.lang.Object
xal.tools.correlator.Correlation<T>

public class Correlation<T> extends Object
Correlation is a generic container of correlated records.
Author:
tap
  • Constructor Details

  • Method Details

    • isCorrelated

      public boolean isCorrelated(String sourceName)
      Check if the named source is among the correlated.
      Parameters:
      sourceName - A name uniquely identifying a source (and record)
      Returns:
      true if the sourceName identifies a record in this correlation and false otherwise.
    • numRecords

      public int numRecords()
      Get the number of records correlated.
      Returns:
      the number of records correlated.
    • names

      public Collection<String> names()
      Get the collection of names each of which identifies a record.
      Returns:
      The collection of names for correlated records.
    • getRecords

      public final Collection<T> getRecords()
      Get a collection of the records in the correlation.
      Returns:
      Collection of records in the correlation.
      See Also:
    • getRecord

      public final T getRecord(String name)
      Get the record identified by the source name (same one registered with the correlator). In general this record can be any class that the specific implementation chooses to make. The record holds the value and time stamp of the specific measurement (e.g. PV timestamp and value). For a ChannelCorrelator, this method returns a ChannelTimeRecord.
      Parameters:
      name - The name that identifies the desired record.
      Returns:
      The record corresponding to the specified name.
    • contains

      public boolean contains(Correlation<T> correlation)
      Check whether this correlation contains all of the records of a specified correlation.
      Parameters:
      correlation - The correlation to test for being contained within this
      Returns:
      true if this correlation contains all of the records of the specified correlation and false otherwise.
    • meanTimeInSeconds

      public double meanTimeInSeconds()
      Average time of the time stamps from the records in seconds since the Java epoch
      Returns:
      The mean time in seconds.
    • meanDate

      public Date meanDate()
      Convenience method to get a Java date for a given time stamp by averaging the dates of the records.
      Returns:
      The mean date of this correlation.
    • toString

      public String toString()
      String representation of the correlation useful for printing
      Overrides:
      toString in class Object
      Returns:
      The string representation of this correlation.