Class semper.preferences.IntegerStringConstraints
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.4 $ $Date: 1997/01/17 19:53:03 $
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 myStreamSize()
Returns the size of the stream that would hold the externalized form of these constraints.
 o readObject(StreamInputInterface)
Internalizes a Constraint from a stream.
 o showInfo(Frame, String)
Display a window with the bound for that integer.
 o writeObject(StreamOutputInterface)
Externalizes this constraint in order for it to be stored whithin a PrefFieldString.

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.
 o myStreamSize
  public int myStreamSize() throws StreamIOException
Returns the size of the stream that would hold the externalized form of these constraints.
Returns:
the size of the stream in bytes
See Also:
Streamable
 o readObject
  public void readObject(StreamInputInterface stream) throws StreamIOException
Internalizes a Constraint from a stream.
Parameters:
stream - is the stream of data the object state is retrieved from
Returns:
none.
See Also:
Streamable
 o writeObject
  public void writeObject(StreamOutputInterface stream) throws StreamIOException
Externalizes this constraint in order for it to be stored whithin a PrefFieldString.
Parameters:
stream - is the stream of data the object state is recorded in
Returns:
none
See Also:
Streamable

All Packages  Class Hierarchy  This Package  Previous  Next  Index