All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.preferences.IntegerStringConstraints

java.lang.Object
   |
   +----semper.preferences.IntegerStringConstraints

public class IntegerStringConstraints
extends Object
implements StringConstraints
This is used when a PrefFieldString is used to represent a Integer value. It is possible to define a lower and an upper bound between which the integer value must be.

Version:
$Revision: 1.7 $ $Date: 1997/09/26 16:29:24 $
Author:
Louis Salvail
See Also:
PrefFieldString

Variable Index

 o _lowerBound
 o _upperBound

Constructor Index

 o IntegerStringConstraints()
Constructor for an integer whithout other constraints.
 o IntegerStringConstraints(int, int)
Contructor for integer constraints between two values.

Method Index

 o convert(String)
Returns the integer encoded in the input string.
 o isSatisfied(String)
Indicates if a string encodes an integer between the bounds.
 o showInfo(Frame, String)
Display a window with the bound for that integer.

Variables

 o _lowerBound
 public int _lowerBound
 o _upperBound
 public int _upperBound

Constructors

 o IntegerStringConstraints
 public IntegerStringConstraints()
Constructor for an integer whithout other constraints.

Returns:
the new constraints object for an arbitrarily integer.
See Also:
Integer
 o IntegerStringConstraints
 public IntegerStringConstraints(int lowBound,
                                 int upBound)
Contructor for integer constraints between two values.

Parameters:
lowBound - is the lower bound for the integer value.
upBound - is the upper bound for the integer value.
Returns:
the new object.
See Also:
Integer

Methods

 o isSatisfied
 public boolean isSatisfied(String s)
Indicates if a string encodes an integer between the bounds. If no bound has been defined, true is returned given the string encodes an Integer.

Parameters:
s - the string to test.
Returns:
true if and only if the string represents an Integer number between the two selected bound.
See Also:
Integer
 o convert
 public Object convert(String s) throws StringConversionException
Returns the integer encoded in the input string.

Parameters:
s - is the string to convert.
Returns:
the Integer encoded in the string.
Throws: StringConversionException
if the string could not be converted.
 o showInfo
 public void showInfo(Frame parent,
                      String fieldName)
Display a window with the bound for that integer.

Parameters:
parent - is the parent frame.
fieldName - is the name of the field.
Returns:
none.

All Packages  Class Hierarchy  This Package  Previous  Next  Index