net.percederberg.mib.type
Class ValueConstraint
java.lang.Object
|
+--net.percederberg.mib.type.Constraint
|
+--net.percederberg.mib.type.ValueConstraint
- public class ValueConstraint
- extends Constraint
A class representing a single value constraint.
- Version:
- 1.0
- Author:
- Per Cederberg, per@percederberg.net
Constructor Summary |
ValueConstraint(java.lang.Number value)
Creates a new value constraint with the given value. |
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. |
protected int |
value()
Returns the integer value for this constraint. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ValueConstraint
public ValueConstraint(java.lang.Number value)
- Creates a new value constraint with the given value.
- Parameters:
value
- the constraint value
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
value
protected int value()
- Returns the integer value for this constraint.
- Returns:
- the integer value