net.percederberg.mib.type
Class SizeConstraint
java.lang.Object
|
+--net.percederberg.mib.type.Constraint
|
+--net.percederberg.mib.type.SizeConstraint
- public class SizeConstraint
- extends Constraint
A class representing a size constraint (for strings).
- Version:
- 1.0
- Author:
- Per Cederberg, per@percederberg.net
Method Summary |
boolean |
equals(java.lang.Object obj)
Checks if this constraint equals another constraint. |
java.lang.String |
toString()
Returns a string description of this constraint. |
void |
transferConstraint(TypeConverter converter)
Transfers the constraint information from this object to a type
converter object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SizeConstraint
public SizeConstraint(ValueConstraint value)
- Creates a new size constraint with fixed size.
- Parameters:
value
- the fixed size value
SizeConstraint
public SizeConstraint(ValueRangeConstraint range)
- Creates a new size constraint with a range of values.
- Parameters:
range
- a value constraint of the size range
equals
public boolean equals(java.lang.Object obj)
- Checks if this constraint equals another constraint.
- Overrides:
equals
in class Constraint
- Parameters:
obj
- the object to compare with- Returns:
- true if the objects are equal, or
false otherwise
toString
public java.lang.String toString()
- Returns a string description of this constraint.
- Overrides:
toString
in class Constraint
- Returns:
- a string description
transferConstraint
public void transferConstraint(TypeConverter converter)
- Transfers the constraint information from this object to a type
converter object. The calling conventions declared in the
TypeConverter class are followed.
- Overrides:
transferConstraint
in class Constraint
- Parameters:
converter
- a type converter