se.js.jesdob.query.condition
Class NumericCondition

java.lang.Object
  extended by se.js.jesdob.query.condition.NumericCondition
Direct Known Subclasses:
BiggerOrEqualToCondition, BiggerThanCondition, IsNotNumericCondition, IsNumericCondition, LesserOrEqualToCondition, LesserThanCondition

public abstract class NumericCondition
extends java.lang.Object

Numeric conditon is an abstract base class for numeric condition, containing reusable function for processing numeric data.


Constructor Summary
NumericCondition()
           
 
Method Summary
protected static double getNumeric(java.lang.String str)
          Returns the numeric value for specific string.
protected static boolean isNumeric(java.lang.String str)
          Checks if a specific string is possible to treat as numeric data or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericCondition

public NumericCondition()
Method Detail

isNumeric

protected static boolean isNumeric(java.lang.String str)
Checks if a specific string is possible to treat as numeric data or not.

Parameters:
str - The string we want to check if can be treated as numeric data.
Returns:
If the string could be treated as numeric data or not.

getNumeric

protected static double getNumeric(java.lang.String str)
Returns the numeric value for specific string. You need to make sure that the string can be converted to a number before calling this function. If the string could not be converted to a number, and exception will be thrown.

Parameters:
str - The string we want to convert to numeric data.
Returns:
The numeric data, created from the string.