|
Formula 1.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objecthirondelle.formula.function.Check
public final class Check
Utility class for validating the parameters passed to a Function
.
If a problem is found, all methods in this class will throw a RuntimeException.
Some methods in this class take a String name argument. This is simply used to provide a more informative message, in case of an error.
The built-in functions use this class to validate their arguments. You are encouraged to do the same, but you are not obliged to use this class. You may validate the arguments passed to your own custom functions in any way that's best for you.
Method Summary | |
---|---|
static void |
date(Decimal aYear,
Decimal aMonth,
Decimal aDay)
Verify that the given year-month-day can form a date. |
static void |
integer(Decimal aArg,
String aName)
Verify that the given value has no fractional value (has no decimals). |
static void |
negative(Decimal aArg,
String aName)
Verify that the given value is less than 0. |
static void |
nonNegative(Decimal aArg,
String aName)
Verify that the given value is greater than or equal to 0. |
static void |
nonPositive(Decimal aArg,
String aName)
Verify that the given value is less than or equal to 0. |
static void |
numArgs(int aExpected,
Decimal... aAllArgs)
Verify that the number of arguments passed to the function matches an expected value. |
static void |
oneArg(Decimal... aAllArgs)
Verify that the function has been passed exactly 1 argument. |
static void |
positive(Decimal aArg,
String aName)
Verify that the given value is greater than 0. |
static void |
positiveInteger(Decimal aArg,
String aName)
Verify that the given value is both greater than 0, and has no fractional value (has no decimals). |
static void |
range(Decimal aArg,
String aName,
Decimal aLow,
Decimal aHigh)
Verify that the given value is in a given range (inclusive). |
static void |
twoArgs(Decimal... aAllArgs)
Verify that the function has been passed exactly 2 arguments. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void numArgs(int aExpected, Decimal... aAllArgs)
public static void oneArg(Decimal... aAllArgs)
public static void twoArgs(Decimal... aAllArgs)
public static void integer(Decimal aArg, String aName)
public static void positive(Decimal aArg, String aName)
public static void negative(Decimal aArg, String aName)
public static void range(Decimal aArg, String aName, Decimal aLow, Decimal aHigh)
public static void nonNegative(Decimal aArg, String aName)
public static void nonPositive(Decimal aArg, String aName)
public static void positiveInteger(Decimal aArg, String aName)
public static void date(Decimal aYear, Decimal aMonth, Decimal aDay)
aYear
- a positive integeraMonth
- integer in the range 1..12 (inclusive)aDay
- in the range 1..31 (inclusive), with possible fractional day.
|
Formula 1.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |