org.infoglue.cms.applications.workflowtool.util
Class RangeCheck

java.lang.Object
  extended by org.infoglue.cms.applications.workflowtool.util.RangeCheck

public class RangeCheck
extends java.lang.Object

Utility class for checking if an integer is within a (possible open-ended) range.


Field Summary
static int BETWEEN
          Return code if the checked value is outside the range and the range is [x,y].
static int BETWEEN_ONE_AND_MANY
          Return code if the checked value is outside the range and the range is [1,y].
static int EXACTLY
          Return code if the checked value is outside the range and the range is [x,x].
static int EXACTLY_ONE
          Return code if the checked value is outside the range and the range is [1,1].
static int GREATER_THAN
          Return code if the checked value is outside the range and the range is [x,[.
static int GREATER_THAN_ONE
          Return code if the checked value is outside the range and the range is [1,[.
static int LESS_THAN
          Return code if the checked value is outside the range and the range is ],x].
static int OK
          Return code if the checked value is inside the range.
 
Constructor Summary
RangeCheck(java.lang.Integer min, java.lang.Integer max)
          Constructs an object with the specified limits.
 
Method Summary
 int check(int value)
          Checks if the specified value is within the range.
 java.lang.Integer getMax()
          Returns the upper limit or null if open-ended.
 java.lang.Integer getMin()
          Returns the lower limit or null if open-ended.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final int OK
Return code if the checked value is inside the range.

See Also:
Constant Field Values

EXACTLY

public static final int EXACTLY
Return code if the checked value is outside the range and the range is [x,x].

See Also:
Constant Field Values

EXACTLY_ONE

public static final int EXACTLY_ONE
Return code if the checked value is outside the range and the range is [1,1].

See Also:
Constant Field Values

LESS_THAN

public static final int LESS_THAN
Return code if the checked value is outside the range and the range is ],x].

See Also:
Constant Field Values

GREATER_THAN

public static final int GREATER_THAN
Return code if the checked value is outside the range and the range is [x,[.

See Also:
Constant Field Values

GREATER_THAN_ONE

public static final int GREATER_THAN_ONE
Return code if the checked value is outside the range and the range is [1,[.

See Also:
Constant Field Values

BETWEEN

public static final int BETWEEN
Return code if the checked value is outside the range and the range is [x,y].

See Also:
Constant Field Values

BETWEEN_ONE_AND_MANY

public static final int BETWEEN_ONE_AND_MANY
Return code if the checked value is outside the range and the range is [1,y].

See Also:
Constant Field Values
Constructor Detail

RangeCheck

public RangeCheck(java.lang.Integer min,
                  java.lang.Integer max)
Constructs an object with the specified limits.

Parameters:
min - the lower limit; a null value indicates an open end.
min - the upper limit; a null value indicates an open end.
Method Detail

getMin

public final java.lang.Integer getMin()
Returns the lower limit or null if open-ended.

Returns:
the lower limit or null if open-ended.

getMax

public final java.lang.Integer getMax()
Returns the upper limit or null if open-ended.

Returns:
the upper limit or null if open-ended.

check

public final int check(int value)
Checks if the specified value is within the range.

Parameters:
value - the value to check.
Returns:
a code representing the result.


Copyright © 2005 InfoGlue.org All Rights Reserved.