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
-
_lowerBound
-
-
_upperBound
-
-
IntegerStringConstraints()
- Constructor for an integer whithout other constraints.
-
IntegerStringConstraints(int, int)
- Contructor for integer constraints between two values.
-
convert(String)
- Returns the integer encoded in the input string.
-
isSatisfied(String)
- Indicates if a string encodes an integer between the bounds.
-
myStreamSize()
- Returns the size of the stream that would hold the externalized form of these constraints.
-
readObject(StreamInputInterface)
- Internalizes a Constraint from a stream.
-
showInfo(Frame, String)
- Display a window with the bound for that integer.
-
writeObject(StreamOutputInterface)
- Externalizes this constraint in order for it to be stored whithin
a PrefFieldString.
_lowerBound
public int _lowerBound
_upperBound
public int _upperBound
IntegerStringConstraints
public IntegerStringConstraints()
- Constructor for an integer whithout other constraints.
- Returns:
- the new constraints object for an arbitrarily integer.
- See Also:
- Integer
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
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
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.
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.
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
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
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