Package xal.tools.correlator
Class Correlation<T>
java.lang.Object
xal.tools.correlator.Correlation<T>
Correlation is a generic container of correlated records.
- Author:
- tap
-
Constructor Summary
ConstructorsConstructorDescriptionCorrelation
(Map<String, T> newRecordTable, UnivariateStatistics newTimeStatistics) Creates new Correlation -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(Correlation<T> correlation) Check whether this correlation contains all of the records of a specified correlation.final T
Get the record identified by the source name (same one registered with the correlator).final Collection<T>
Get a collection of the records in the correlation.boolean
isCorrelated
(String sourceName) Check if the named source is among the correlated.meanDate()
Convenience method to get a Java date for a given time stamp by averaging the dates of the records.double
Average time of the time stamps from the records in seconds since the Java epochnames()
Get the collection of names each of which identifies a record.int
Get the number of records correlated.toString()
String representation of the correlation useful for printing
-
Constructor Details
-
Correlation
Creates new Correlation
-
-
Method Details
-
numRecords
public int numRecords()Get the number of records correlated.- Returns:
- the number of records correlated.
-
names
Get the collection of names each of which identifies a record.- Returns:
- The collection of names for correlated records.
-
getRecords
Get a collection of the records in the correlation.- Returns:
- Collection of records in the correlation.
- See Also:
-
getRecord
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
Check whether this correlation contains all of the records of a specified correlation.- Parameters:
correlation
- The correlation to test for being contained withinthis
- 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
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
String representation of the correlation useful for printing