|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<RoundingMode>
org.qtitools.qti.node.expression.operator.RoundingMode
public enum RoundingMode
Enumeration for equalRounded expression.
EqualRounded| Enum Constant Summary | |
|---|---|
DECIMAL_PLACES
Number is rounded to A given number of decimal places. |
|
SIGNIFICANT_FIGURES
Number is rounded to A given number of significant figures. |
|
| Field Summary | |
|---|---|
static java.lang.String |
CLASS_TAG
Name of this class in xml schema. |
| Method Summary | |
|---|---|
boolean |
isEqual(double firstNumber,
double secondNumber,
int figures)
Returns true if given two numbers are equal after rounding; false otherwise. |
static RoundingMode |
parseRoundingMode(java.lang.String roundingMode)
Parses string representation of RoundingMode. |
protected abstract java.math.BigDecimal |
round(double number,
int figures)
Rounds given number for given number of figures. |
java.lang.String |
toString()
|
abstract ValidationResult |
validateFigures(Attribute attribute,
int figures)
Validates figures attribute. |
static RoundingMode |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static RoundingMode[] |
values()
Returns an array containing the constants of this enum type, in the order they're declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final RoundingMode SIGNIFICANT_FIGURES
public static final RoundingMode DECIMAL_PLACES
| Field Detail |
|---|
public static final java.lang.String CLASS_TAG
| Method Detail |
|---|
public static final RoundingMode[] values()
for(RoundingMode c : RoundingMode.values())
System.out.println(c);
public static RoundingMode valueOf(java.lang.String name)
name - the name of the enum constant to be returned.
java.lang.IllegalArgumentException - if this enum type has no constant
with the specified name
public abstract ValidationResult validateFigures(Attribute attribute,
int figures)
attribute - attribute to be validatedfigures - attribute's value to be validated
protected abstract java.math.BigDecimal round(double number,
int figures)
number - numberfigures - number of figures
public boolean isEqual(double firstNumber,
double secondNumber,
int figures)
firstNumber - first number to comparesecondNumber - second number to comparefigures - rounding figures
public java.lang.String toString()
toString in class java.lang.Enum<RoundingMode>public static RoundingMode parseRoundingMode(java.lang.String roundingMode)
RoundingMode.
roundingMode - string representation of RoundingMode
RoundingMode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||