Project Wonder 2.0

com.gammastream.validity
Class GSVNumberMethods

java.lang.Object
  extended bycom.gammastream.validity.GSVNumberMethods

public class GSVNumberMethods
extends Object

This class provides a set of predefined rules for performing validation on Numbers. These rules are part of the default set of 'QuickRules'.

Author:
GammaStream Technologies, Inc.

Field Summary
static String EQUAL
          For programatic purposes, we include this constant which is used for the compareTo method.
static String GREATER_EQUAL
          For programatic purposes, we include this constant which is used for the compareTo method.
static String GREATER_THAN
          For programatic purposes, we include this constant which is used for the compareTo method.
static String LESS_EQUAL
          For programatic purposes, we include this constant which is used for the compareTo method.
static String LESS_THAN
          For programatic purposes, we include this constant which is used for the compareTo method.
static String NOT_EQUAL
          For programatic purposes, we include this constant which is used for the compareTo method.
 
Constructor Summary
GSVNumberMethods()
           
 
Method Summary
static boolean compareTo(Object object, Object attribute, String key, NSDictionary params)
          Compares the specified attribute to a number provided in the params dictionary.
static boolean isInRange(Object object, Object attribute, String key, NSDictionary params)
          Checks to make sure the attribute falls within the range specified in the params dictionary.
static boolean isNegativeNumber(Object object, Object attribute, String key, NSDictionary params)
          Verifies that attribute is a negative number.
static boolean isPositiveNumber(Object object, Object attribute, String key, NSDictionary params)
          Verifies that attribute is a positive number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EQUAL

public static final String EQUAL
For programatic purposes, we include this constant which is used for the compareTo method.

See Also:
Constant Field Values

NOT_EQUAL

public static final String NOT_EQUAL
For programatic purposes, we include this constant which is used for the compareTo method.

See Also:
Constant Field Values

GREATER_THAN

public static final String GREATER_THAN
For programatic purposes, we include this constant which is used for the compareTo method.

See Also:
Constant Field Values

GREATER_EQUAL

public static final String GREATER_EQUAL
For programatic purposes, we include this constant which is used for the compareTo method.

See Also:
Constant Field Values

LESS_THAN

public static final String LESS_THAN
For programatic purposes, we include this constant which is used for the compareTo method.

See Also:
Constant Field Values

LESS_EQUAL

public static final String LESS_EQUAL
For programatic purposes, we include this constant which is used for the compareTo method.

See Also:
Constant Field Values
Constructor Detail

GSVNumberMethods

public GSVNumberMethods()
Method Detail

compareTo

public static final boolean compareTo(Object object,
                                      Object attribute,
                                      String key,
                                      NSDictionary params)
Compares the specified attribute to a number provided in the params dictionary.

The required key-value pairs include:
"Operator" = The specified operator string. (i.e. "==", "!=", ">", ">=", "<", or "<=" )
"RightOperand" = The number to compare the attribute to. (i.e. 0, 20, etc.)

Parameters:
object - The object whose attribute is being validated.
attribute - The attribute being validated.
key - The key used to access the attribute.
params - The param dictionary which must contain the above mentioned key-value pairs.
Returns:
true if the comparision succeeds; otherwise, false

isInRange

public static final boolean isInRange(Object object,
                                      Object attribute,
                                      String key,
                                      NSDictionary params)
Checks to make sure the attribute falls within the range specified in the params dictionary.
The attribute is allowed to equal the 'Low' or 'High' value.

The required key-value pairs include:
"Low" = The lowest possible value for this attribute.
"High" = The highest possible value for this attribute.

Parameters:
object - The object whose attribute is being validated.
attribute - The attribute being validated.
key - The key used to access the attribute.
params - The param dictionary which must contain the above mentioned key-value pairs.
Returns:
true if the provided number false within the specified range; otherwise, false

isPositiveNumber

public static final boolean isPositiveNumber(Object object,
                                             Object attribute,
                                             String key,
                                             NSDictionary params)
Verifies that attribute is a positive number.

Parameters:
object - The object whose attribute is being validated.
attribute - The attribute being validated.
key - The key used to access the attribute.
params - The param dictionary which must contain the above mentioned key-value pairs.
Returns:
true if the provided number is positive value; otherwise, false

isNegativeNumber

public static final boolean isNegativeNumber(Object object,
                                             Object attribute,
                                             String key,
                                             NSDictionary params)
Verifies that attribute is a negative number.

Parameters:
object - The object whose attribute is being validated.
attribute - The attribute being validated.
key - The key used to access the attribute.
params - The param dictionary which must contain the above mentioned key-value pairs.
Returns:
true if the provided number is a negative value; otherwise, false

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.