org.qtitools.qti.node.expression.operator
Enum ToleranceMode

java.lang.Object
  extended by java.lang.Enum<ToleranceMode>
      extended by org.qtitools.qti.node.expression.operator.ToleranceMode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ToleranceMode>

public enum ToleranceMode
extends java.lang.Enum<ToleranceMode>

Enumeration for equal expression.

Author:
Jiri Kajaba
See Also:
Equal

Enum Constant Summary
ABSOLUTE
          In absolute mode the result of the comparison is true if the value of the second expression, y is within the following range defined by the first value, x.
EXACT
          Exact comparing.
RELATIVE
          In relative mode, t0 and t1 are treated as percentages and the following range is used instead.
 
Field Summary
static java.lang.String CLASS_TAG
          Name of this class in xml schema.
 
Method Summary
abstract  boolean isEqual(double firstNumber, double secondNumber, double tolerance1, double tolerance2, boolean includeLowerBound, boolean includeUpperBound)
          Returns true if given numbers are equal; false otherwise.
static ToleranceMode parseToleranceMode(java.lang.String toleranceMode)
          Parses string representation of ToleranceMode.
 java.lang.String toString()
           
static ToleranceMode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ToleranceMode[] 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

EXACT

public static final ToleranceMode EXACT
Exact comparing. No tolerances are needed.


ABSOLUTE

public static final ToleranceMode ABSOLUTE
In absolute mode the result of the comparison is true if the value of the second expression, y is within the following range defined by the first value, x.

x - t0, x + t1


RELATIVE

public static final ToleranceMode RELATIVE
In relative mode, t0 and t1 are treated as percentages and the following range is used instead.

x * (1 - t0 / 100), x * (1 + t1 / 100)

Field Detail

CLASS_TAG

public static final java.lang.String CLASS_TAG
Name of this class in xml schema.

See Also:
Constant Field Values
Method Detail

values

public static final ToleranceMode[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(ToleranceMode c : ToleranceMode.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static ToleranceMode valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

isEqual

public abstract boolean isEqual(double firstNumber,
                                double secondNumber,
                                double tolerance1,
                                double tolerance2,
                                boolean includeLowerBound,
                                boolean includeUpperBound)
Returns true if given numbers are equal; false otherwise.

Parameters:
firstNumber - first number to compare
secondNumber - second number to compare
tolerance1 - tolerance for lower boundary
tolerance2 - tolerance for upper boundary
includeLowerBound - accept lower boundary
includeUpperBound - accept upper boundary
Returns:
true if given numbers are equal; false otherwise

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<ToleranceMode>

parseToleranceMode

public static ToleranceMode parseToleranceMode(java.lang.String toleranceMode)
Parses string representation of ToleranceMode.

Parameters:
toleranceMode - string representation of ToleranceMode
Returns:
parsed ToleranceMode


Copyright © 2009. All Rights Reserved.