Package net.sf.basedb.core
Enum Formula.AverageMethod
- java.lang.Object
-
- java.lang.Enum<Formula.AverageMethod>
-
- net.sf.basedb.core.Formula.AverageMethod
-
- All Implemented Interfaces:
Serializable
,Comparable<Formula.AverageMethod>
- Enclosing class:
- Formula
public static enum Formula.AverageMethod extends Enum<Formula.AverageMethod>
The average method used for the values of this formula. The average is only useful with aFormula.Type.COLUMN_EXPRESSION
.- Version:
- 2.4
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ARITHMETIC_MEAN
GEOMETRIC_MEAN
MAX
MIN
NONE
QUADRATIC_MEAN
-
Field Summary
Fields Modifier and Type Field Description private String
displayValue
private int
value
private static Map<Integer,Formula.AverageMethod>
valueMapping
Maps the integer that is stored in the database.
-
Constructor Summary
Constructors Modifier Constructor Description private
AverageMethod(int value, String displayValue)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Formula.AverageMethod
fromValue(int value)
Get theFormula.AverageMethod
object when you know the integer code.abstract Expression
getAverageExpression(Expression e)
Given an expression, create an expression that takes the correct average of it.int
getValue()
Get the integer value that is used when storing aFormula.AverageMethod
in the database.String
toString()
static Formula.AverageMethod
valueOf(String name)
Returns the enum constant of this type with the specified name.static Formula.AverageMethod[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final Formula.AverageMethod NONE
-
GEOMETRIC_MEAN
public static final Formula.AverageMethod GEOMETRIC_MEAN
-
ARITHMETIC_MEAN
public static final Formula.AverageMethod ARITHMETIC_MEAN
-
MIN
public static final Formula.AverageMethod MIN
-
MAX
public static final Formula.AverageMethod MAX
-
QUADRATIC_MEAN
public static final Formula.AverageMethod QUADRATIC_MEAN
-
-
Field Detail
-
valueMapping
private static final Map<Integer,Formula.AverageMethod> valueMapping
Maps the integer that is stored in the database.
-
value
private final int value
-
displayValue
private final String displayValue
-
-
Constructor Detail
-
AverageMethod
private AverageMethod(int value, String displayValue)
-
-
Method Detail
-
values
public static Formula.AverageMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Formula.AverageMethod c : Formula.AverageMethod.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Formula.AverageMethod valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
fromValue
public static Formula.AverageMethod fromValue(int value)
Get theFormula.AverageMethod
object when you know the integer code.- Parameters:
value
- The integer value.- Returns:
- The AverageMethod object or null if the value is unknown
-
getAverageExpression
public abstract Expression getAverageExpression(Expression e)
Given an expression, create an expression that takes the correct average of it.- Parameters:
e
- The expression, null is not allowed- Returns:
- The average expression, or null if it is not possible to create an average expression
-
getValue
public int getValue()
Get the integer value that is used when storing aFormula.AverageMethod
in the database.- Returns:
- The integer value of this type
-
toString
public String toString()
- Overrides:
toString
in classEnum<Formula.AverageMethod>
-
-