Class StatsHelper
- java.lang.Object
-
- weka.core.expressionlanguage.weka.StatsHelper
-
- All Implemented Interfaces:
java.io.Serializable,VariableDeclarations
public class StatsHelper extends java.lang.Object implements VariableDeclarations
A helper class to expose a Stats object to a program Exposes the following variables that correspond to Stats' fields:- MAX
- MIN
- MEAN
- SD
- COUNT
- SUM
- SUMSQUARED
- Version:
- $Revision: 1000 $
- Author:
- Benjamin Weber ( benweber at student dot ethz dot ch )
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StatsHelper()Construct aStatsHelper
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodegetVariable(java.lang.String name)Tries to fetch a Stats fieldbooleanhasVariable(java.lang.String name)Returns whether the variable is declaredvoidsetStats(Stats stats)Sets the corresponding Stats objectbooleanused()Whether Stats fields are accessed in the programbooleanused(java.lang.String name)Returns whether the Stats field is used in the program
-
-
-
Constructor Detail
-
StatsHelper
public StatsHelper()
Construct aStatsHelper
-
-
Method Detail
-
setStats
public void setStats(Stats stats)
Sets the corresponding Stats object- Parameters:
stats- the Stats object whose fields should be exposed
-
used
public boolean used()
Whether Stats fields are accessed in the program This is only meaningful after compilation.- Returns:
- Whether Stats fields are accessed in the program
-
used
public boolean used(java.lang.String name)
Returns whether the Stats field is used in the program Must be one of the exposed variables. This is only meaningful after compilation.- Parameters:
name- The name of the variable of the Stats field- Returns:
- whether the Stats field is used in the program
-
hasVariable
public boolean hasVariable(java.lang.String name)
Returns whether the variable is declared- Specified by:
hasVariablein interfaceVariableDeclarations- Parameters:
name- name of the variable- Returns:
- whether the variable has been declared
-
getVariable
public Node getVariable(java.lang.String name)
Tries to fetch a Stats field The same invariant ofVariableDeclarationapplies here too.- Specified by:
getVariablein interfaceVariableDeclarations- Parameters:
name- name of the variable- Returns:
- node representing the Stats field
-
-