Class StatsHelper
java.lang.Object
weka.core.expressionlanguage.weka.StatsHelper
- All Implemented Interfaces:
Serializable
,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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetVariable
(String name) Tries to fetch a Stats fieldboolean
hasVariable
(String name) Returns whether the variable is declaredvoid
Sets the corresponding Stats objectboolean
used()
Whether Stats fields are accessed in the programboolean
Returns whether the Stats field is used in the program
-
Constructor Details
-
StatsHelper
public StatsHelper()Construct aStatsHelper
-
-
Method Details
-
setStats
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
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
Returns whether the variable is declared- Specified by:
hasVariable
in interfaceVariableDeclarations
- Parameters:
name
- name of the variable- Returns:
- whether the variable has been declared
-
getVariable
Tries to fetch a Stats field The same invariant ofVariableDeclaration
applies here too.- Specified by:
getVariable
in interfaceVariableDeclarations
- Parameters:
name
- name of the variable- Returns:
- node representing the Stats field
-