public class WeightedProperty
extends java.lang.Object
weight
attribute. The property name is a unique String
that a TestObject
understands and can associate a particular value with. The weight
attribute is a value
in the range of MIN_WEIGHT
to MAX_WEIGHT
that defines the relative
importance of this property to the associated TestObject
. A weight of MIN_WEIGHT
,
that is, zero means that the property has no importance, while a weight of MAX_WEIGHT
implies that the property is very important. Weights between these values indicate the relative importance
of the property.Modifier and Type | Field and Description |
---|---|
static int |
MAX_WEIGHT
Defines the maximum value that can be assigned to a
weight attribute. |
static int |
MIN_WEIGHT
Defines the minimum value that can be assigned to a
weight attribute. |
Constructor and Description |
---|
WeightedProperty(java.lang.String property,
java.lang.Object value,
int weight)
Builds a
Property (name, value, weight) object. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Compares the property's
name and value attributes to the supplied
object's attributes. |
java.lang.String |
getProperty()
Returns the property
name attribute associated with this object. |
java.lang.Object |
getValue()
Returns the property
value attribute associated with this object. |
int |
getWeight()
Returns the property
weight attribute associated with this object. |
java.lang.String |
toString()
Returns a textual representation of the attributes that make up
this object.
|
public static final int MIN_WEIGHT
weight
attribute. This value
is zero (0).public static final int MAX_WEIGHT
weight
attribute. This value
is one hundred (100).public WeightedProperty(java.lang.String property, java.lang.Object value, int weight)
Property
(name, value, weight) object. A semantic
restriction is enforced in this constructor to ensure that the >weight>
value is in the range MIN_WEIGHT
to MAX_WEIGHT
. weight
values outside this range cause an appropriate exception to be thrown.public java.lang.String getProperty()
name
attribute associated with this object.public java.lang.Object getValue()
value
attribute associated with this object.public int getWeight()
weight
attribute associated with this object.
The weight is in the range MIN_WEIGHT
to
MAX_WEIGHT
.public boolean equals(java.lang.Object o)
name
and value
attributes to the supplied
object's attributes. The method returns true
if the specified object's
name equals the active name and if the associated values are also equal. If the
supplied object is not a WeightedProperty
, the method returns false
.equals
in class java.lang.Object
o
- the right side of the object comparisonpublic java.lang.String toString()
toString
method.toString
in class java.lang.Object