IBM Rational Functional Tester
Version 8.1.1000
IBM Rational Functional Tester API Reference

Project Version 2.3

com.rational.test.ft.script
Class WeightedPropertySet

java.lang.Object   extended by com.rational.test.ft.script.WeightedPropertySet

public class WeightedPropertySet
extends java.lang.Object

Represents a set of recognition properties in encapsulated values. These properties are: property (property name), value, and weight. The property name is a case-sensitive String value that the TestObject accepts as a property name. The value is a java.lang.Object object associated with a specific property name. The value must be a value class so that it can be properly copied to the software under test. The weight is a value in the range MIN_WEIGHT to MAX_WEIGHT. Specifying a weight outside this range causes an exception to be raised.

Since:
RFT1.0
See Also:
WeightedProperty

Field Summary
static int MAX_WEIGHT
          Supplied as a convienence so that WeightedProperty.MAX_WEIGHT can be accessed without having to import the WeightedProperty class.
static int MIN_WEIGHT
          Supplied as a convienence so that WeightedProperty.MIN_WEIGHT can be accessed without having to import the WeightedProperty class.
 
Constructor Summary
WeightedPropertySet()
          Creates an empty property set.
WeightedPropertySet(java.util.Hashtable properties, int weight)
          Creates a property set containing the specified set of property key/value pairs, all with the same weight associated with them.
 
Method Summary
 void add(java.lang.String property, java.lang.Object value)
          Adds the supplied property name and attributes to the current set.
 void add(java.lang.String property, java.lang.Object value, int weight)
          Adds the supplied property name and attributes to the current set.
 void add(WeightedProperty property)
          Adds the supplied property to the current set.
 boolean contains(java.lang.String property)
          Returns true if the specified property name is represented in this set.
 boolean equals(java.lang.Object o)
          Compares each member of this set with those in the supplied set.
 WeightedProperty get(java.lang.String property)
          Returns the attributes that constitute the supplied property.
 java.util.Enumeration getProperties()
          Returns an Enumeration object for the properties that make up this set.
 int getSize()
          Returns the number of elements in the set.
 void remove(java.lang.String property)
          Removes the specified property from the active set.
 void removeAll()
          Removes all properties from this set.
 java.lang.String toString()
          Returns a textual representation of the properties that make up this set.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_WEIGHT

public static final int MIN_WEIGHT
Supplied as a convienence so that WeightedProperty.MIN_WEIGHT can be accessed without having to import the WeightedProperty class.

Since:
RFT1.0
See Also:
Constant Field Values

MAX_WEIGHT

public static final int MAX_WEIGHT
Supplied as a convienence so that WeightedProperty.MAX_WEIGHT can be accessed without having to import the WeightedProperty class.

Since:
RFT1.0
See Also:
Constant Field Values
Constructor Detail

WeightedPropertySet

public WeightedPropertySet()
Creates an empty property set.

Since:
RFT1.0

WeightedPropertySet

public WeightedPropertySet(java.util.Hashtable properties,                            int weight)
Creates a property set containing the specified set of property key/value pairs, all with the same weight associated with them. All of the keys in the supplied properties table must be java.lang.String objects. The supplied weight must be in the range MIN_WEIGHT to MAX_WEIGHT, or an exception is thrown.

Since:
RFT1.0
Method Detail

contains

public boolean contains(java.lang.String property)
Returns true if the specified property name is represented in this set.

Parameters:
property - the property name to be located in this set
Since:
RFT1.0

add

public void add(java.lang.String property,                 java.lang.Object value,                 int weight)
Adds the supplied property name and attributes to the current set. If the property name is already located in the set, the supplied attributes replace those already in the set. The supplied weight must be in the range MIN_WEIGHT to MAX_WEIGHT, or an exception is thrown.

Parameters:
property - the name of the property being added to this set
value - the value attribute associated with the property name
weight - the weight attribute associated with the property name
Since:
RFT1.0

add

public void add(java.lang.String property,                 java.lang.Object value)
Adds the supplied property name and attributes to the current set. If the property name is already located in the set, the supplied attributes replace those already in the set. The implied weight associated with this property is MAX_WEIGHT.

Parameters:
property - The name of the property being added to this set
value - The value attribute associated with the property name
Since:
RFT1.0

add

public void add(WeightedProperty property)
Adds the supplied property to the current set. If the property name is already located in the set, the supplied property replaces the attributes already in the set.

Parameters:
property - the property to add to the current set
Since:
RFT1.0

remove

public void remove(java.lang.String property)
Removes the specified property from the active set. If the specified property is not found, no action is performed.

Parameters:
property - the name of the property to be removed from the current set
Since:
RFT1.0

removeAll

public void removeAll()
Removes all properties from this set.

Since:
RFT1.0

getProperties

public java.util.Enumeration getProperties()
Returns an Enumeration object for the properties that make up this set. Each element in the enumeration is a WeightedProperty object.

Since:
RFT1.0

get

public WeightedProperty get(java.lang.String property)
Returns the attributes that constitute the supplied property. A null value is returned if the property name is not found in the set.

Parameters:
property - The name of the desired property
Since:
RFT1.0

getSize

public int getSize()
Returns the number of elements in the set.

Since:
RFT1.0

toString

public java.lang.String toString()
Returns a textual representation of the properties that make up this set. This method overrides the inherited toString method.

Overrides:
toString in class java.lang.Object
Since:
RFT1.0

equals

public boolean equals(java.lang.Object o)
Compares each member of this set with those in the supplied set. If all properties from both sets exist within each other and have the same values, the sets are considered equal. This method overrides the inherited equals method.

Overrides:
equals in class java.lang.Object
Parameters:
o - the right side of the set comparision
Returns:
The result of the comparison between the members of this set and corresponding members of the supplied set.
Since:
RFT1.0