Package jsl.utilities.statistic.welch
Class WelchFileMetaDataBean
- java.lang.Object
-
- jsl.utilities.statistic.welch.WelchFileMetaDataBean
-
public class WelchFileMetaDataBean extends java.lang.ObjectA data class that holds information about Welch data files in a form that facilitates translation to JSON.
-
-
Constructor Summary
Constructors Constructor Description WelchFileMetaDataBean()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetBatchSize()java.lang.StringgetDataName()double[]getEndReplicationAverages()longgetMinNumObsForReplications()intgetNumberOfReplications()long[]getNumObsInEachReplication()java.lang.StringgetPathToFile()The file will have the wdf extensionjava.lang.StringgetPathToJSONFile()StatisticTypegetStatisticType()double[]getTimeBtwObsInEachReplication()double[]getTimeOfLastObsInEachReplication()booleanisValid()static WelchFileMetaDataBeanmakeFromJSON(java.nio.file.Path pathToJSONFile)static java.util.Optional<WelchFileMetaDataBean>makeFromJSONNE(java.nio.file.Path pathToJSONFile)voidsetBatchSize(double batchSize)voidsetDataName(java.lang.String dataName)voidsetEndReplicationAverages(double[] endReplicationAverages)voidsetMinNumObsForReplications(long minNumObsForReplications)voidsetNumberOfReplications(int numberOfReplications)voidsetNumObsInEachReplication(long[] numObsInEachReplication)voidsetPathToFile(java.lang.String strPathToFile)voidsetStatisticType(StatisticType statisticType)voidsetTimeBtwObsInEachReplication(double[] timeBtwObsInEachReplication)voidsetTimeOfLastObsInEachReplication(double[] timeOfLastObsInEachReplication)java.lang.StringtoJSON()
-
-
-
Method Detail
-
isValid
public boolean isValid()
-
makeFromJSONNE
public static java.util.Optional<WelchFileMetaDataBean> makeFromJSONNE(java.nio.file.Path pathToJSONFile)
- Parameters:
pathToJSONFile- the path to the JSON file holding the bean data, must not be null- Returns:
- an optional holding the bean or null if something went wrong
-
makeFromJSON
public static WelchFileMetaDataBean makeFromJSON(java.nio.file.Path pathToJSONFile) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException
- Parameters:
pathToJSONFile- the path to the JSON file holding the bean data, must not be null- Returns:
- the deserialized bean
- Throws:
java.io.FileNotFoundException- if the file is not foundjava.io.UnsupportedEncodingException- if the UTF-8 encoding is not found
-
toJSON
public java.lang.String toJSON()
- Returns:
- returns a pretty printed JSON representation as a String
-
getStatisticType
public StatisticType getStatisticType()
- Returns:
- the type of statistic held in the data, TALLY or TIME_PERSISTENT
-
setStatisticType
public void setStatisticType(StatisticType statisticType)
-
getDataName
public java.lang.String getDataName()
- Returns:
- the name of the statistic or performance measure held in the file
-
setDataName
public void setDataName(java.lang.String dataName)
-
getPathToFile
public java.lang.String getPathToFile()
The file will have the wdf extension- Returns:
- a valid string representation of the path to the file holding the data
-
getPathToJSONFile
public java.lang.String getPathToJSONFile()
- Returns:
- a string representation of the path to the JSON file related to this bean
-
setPathToFile
public void setPathToFile(java.lang.String strPathToFile)
- Parameters:
strPathToFile- the path to the wdf file
-
getNumberOfReplications
public int getNumberOfReplications()
- Returns:
- the number of replications held in the file
-
setNumberOfReplications
public void setNumberOfReplications(int numberOfReplications)
-
getNumObsInEachReplication
public long[] getNumObsInEachReplication()
- Returns:
- the number of observations in each of the replications, index 0 is replication 1
-
setNumObsInEachReplication
public void setNumObsInEachReplication(long[] numObsInEachReplication)
-
getTimeOfLastObsInEachReplication
public double[] getTimeOfLastObsInEachReplication()
- Returns:
- the time that the last observation occurred in each replication, index 0 is replication 1
-
setTimeOfLastObsInEachReplication
public void setTimeOfLastObsInEachReplication(double[] timeOfLastObsInEachReplication)
-
getMinNumObsForReplications
public long getMinNumObsForReplications()
- Returns:
- the minimum of getNumObsInEachReplication()
-
setMinNumObsForReplications
public void setMinNumObsForReplications(long minNumObsForReplications)
-
getEndReplicationAverages
public double[] getEndReplicationAverages()
- Returns:
- the statistical average of all the observations in each replication, index 0 is replication 1
-
setEndReplicationAverages
public void setEndReplicationAverages(double[] endReplicationAverages)
-
getTimeBtwObsInEachReplication
public double[] getTimeBtwObsInEachReplication()
- Returns:
- the average time between observations for each replication, index 0 is replication 1
-
setTimeBtwObsInEachReplication
public void setTimeBtwObsInEachReplication(double[] timeBtwObsInEachReplication)
-
getBatchSize
public double getBatchSize()
- Returns:
- the size of each batch if batching has been applied.
-
setBatchSize
public void setBatchSize(double batchSize)
-
-