Rule Execution Server API

ilog.rules.factory
Class IlrPropertyList

java.lang.Object
  extended by ilog.rules.factory.IlrPropertyList
All Implemented Interfaces:
Serializable

public class IlrPropertyList
extends Object
implements Serializable

This class is used to manage the properties attached to a ruleset or a rule. An IlrRulesetFactory and an IlrRuleFactory can have properties. They can be defined in the rule language or by API through the methods of this class.

Warning: Serialized objects of this class will not be compatible with future releases. The current serialization support is appropriate for short term storage or RMI between applications running the version of IBM Decision Server.

See Also:
Serialized Form

Nested Class Summary
static class IlrPropertyList.Entry
          This class is an entry of a property list.
 
Constructor Summary
IlrPropertyList()
          Constructs a property list.
 
Method Summary
 void clear()
          Removes all the properties.
 boolean containsKey(String key)
          Tests if the list contains a property.
 boolean containsValue(Object value)
          Tests if the list contains a property of value value.
 IlrPropertyList copy()
          Returns a property list containing the same properties as this object.
 Enumeration elements()
          Returns an enumeration of entries in this list.
 IlrPropertyList.Entry get(String key)
          Gets a property by name.
 Object get(String key, Object def)
          Returns the object value of the specified property.
 boolean getBoolean(String key, boolean def)
          Returns the Boolean value of the specified property.
 char getChar(String key, char def)
          Returns the character value of the specified property.
 double getDouble(String key, double def)
          Returns the double value of the specified property.
 float getFloat(String key, float def)
          Returns the float value of the specified property.
 ArrayList getHierarchicalProperties()
          Returns the properties that are hierarchical properties.
 int getInt(String key, int def)
          Returns the integer value of the specified property.
 long getLong(String key, long def)
          Returns the long value of the specified property.
 String getString(String key, String def)
          Returns the string value of the specified property.
 boolean isEmpty()
          Tests if the property list is empty.
 IlrPropertyList.Entry put(String key, Object value)
          Adds a property to the list.
 IlrPropertyList.Entry put(String key, Object value, boolean hierarchical)
          Adds a property to the list.
 void putAll(IlrPropertyList properties)
          Puts all the entries of properties in this property list.
 void putBoolean(String key, boolean value)
          Adds a property to the list and initializes it with a Boolean value.
 void putChar(String key, char value)
          Adds a property to the list and initializes it with a character value.
 void putDouble(String key, double value)
          Adds a property to the list and initializes it with a double value.
 void putFloat(String key, float value)
          Adds a property to the list and initializes it with a float value.
 void putInt(String key, int value)
          Adds a property to the list and initializes it with an integer value.
 void putLong(String key, long value)
          Adds a property to the list and initializes it with a long value.
 void putString(String key, String value)
          Adds a property to the list and initializes it with a string value.
 IlrPropertyList.Entry remove(String key)
          Removes a property by name.
 int size()
          Gets the number of properties in the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlrPropertyList

public IlrPropertyList()
Constructs a property list. Initially the property list contains no properties.

Method Detail

size

public int size()
Gets the number of properties in the list.

Returns:
The number of properties in the list.

isEmpty

public boolean isEmpty()
Tests if the property list is empty.

Returns:
true if the list contains no properties. Otherwise, it returns false.

elements

public Enumeration elements()
Returns an enumeration of entries in this list.

Returns:
An enumeration of entries.

clear

public void clear()
Removes all the properties.


copy

public IlrPropertyList copy()
Returns a property list containing the same properties as this object.

Returns:
A property list.

putAll

public void putAll(IlrPropertyList properties)
Puts all the entries of properties in this property list.

Parameters:
properties - The property list for which each entry will be added to this list.

containsKey

public boolean containsKey(String key)
Tests if the list contains a property.

Parameters:
key - The property name.
Returns:
true if the list contains the property. Otherwise, it returns false.

containsValue

public boolean containsValue(Object value)
Tests if the list contains a property of value value.

Parameters:
value - A property value.
Returns:
true if the list contains a property of value value. Otherwise, it returns false.

remove

public IlrPropertyList.Entry remove(String key)
Removes a property by name.

Parameters:
key - The property name.
Returns:
The entry of the property, or null if the property does not exist.

get

public IlrPropertyList.Entry get(String key)
Gets a property by name.

Parameters:
key - The property name.
Returns:
The entry of that property, or null if the list does not contain the property.

get

public Object get(String key,
                  Object def)
Returns the object value of the specified property. If the property is not defined, the given default value is returned.

Parameters:
key - The property name.
def - The default value to return if the property is not defined.

getString

public String getString(String key,
                        String def)
Returns the string value of the specified property. If the property is not defined, the given default value is returned.

Parameters:
key - The property name.
def - The default value to return if the property is not defined.

getBoolean

public boolean getBoolean(String key,
                          boolean def)
Returns the Boolean value of the specified property. If the property is not defined, the given default value is returned.

Parameters:
key - The property name.
def - The default value to return if the property is not defined.

getChar

public char getChar(String key,
                    char def)
Returns the character value of the specified property. If the property is not defined, the given default value is returned.

Parameters:
key - The property name.
def - The default value to return if the property is not defined.

getInt

public int getInt(String key,
                  int def)
Returns the integer value of the specified property. If the property is not defined, the given default value is returned.

Parameters:
key - The property name.
def - The default value to return if the property is not defined.

getLong

public long getLong(String key,
                    long def)
Returns the long value of the specified property. If the property is not defined, the given default value is returned.

Parameters:
key - The property name.
def - The default value to return if the property is not defined.

getFloat

public float getFloat(String key,
                      float def)
Returns the float value of the specified property. If the property is not defined, the given default value is returned.

Parameters:
key - The property name.
def - The default value to return if the property is not defined.

getDouble

public double getDouble(String key,
                        double def)
Returns the double value of the specified property. If the property is not defined, the given default value is returned.

Parameters:
key - The property name.
def - The default value to return if the property is not defined.

put

public IlrPropertyList.Entry put(String key,
                                 Object value)
Adds a property to the list. If a property of the name already exists, its value will be replaced. In the case of a hierarchical property, use the API IlrPropertyList.put(String key,Object value, boolean hierarchical).

Parameters:
key - The property name.
value - The property value.
Returns:
The entry of the property.

put

public IlrPropertyList.Entry put(String key,
                                 Object value,
                                 boolean hierarchical)
Adds a property to the list. If a property of the name already exists, its value will be replaced. This API must be used to add a hierarchical property.

Parameters:
key - The property name.
value - The property value.
hierarchical - true if the property is hierarchical.
Returns:
The entry of the property.

putString

public void putString(String key,
                      String value)
Adds a property to the list and initializes it with a string value.

Parameters:
key - The property name.
value - The property value.

putBoolean

public void putBoolean(String key,
                       boolean value)
Adds a property to the list and initializes it with a Boolean value.

Parameters:
key - The property name.
value - The property value.

putChar

public void putChar(String key,
                    char value)
Adds a property to the list and initializes it with a character value.

Parameters:
key - The property name.
value - The property value.

putInt

public void putInt(String key,
                   int value)
Adds a property to the list and initializes it with an integer value.

Parameters:
key - The property name.
value - The property value.

putLong

public void putLong(String key,
                    long value)
Adds a property to the list and initializes it with a long value.

Parameters:
key - The property name.
value - The property value.

putFloat

public void putFloat(String key,
                     float value)
Adds a property to the list and initializes it with a float value.

Parameters:
key - The property name.
value - The property value.

putDouble

public void putDouble(String key,
                      double value)
Adds a property to the list and initializes it with a double value.

Parameters:
key - The property name.
value - The property value.

getHierarchicalProperties

public ArrayList getHierarchicalProperties()
Returns the properties that are hierarchical properties.

Returns:
A list that contains all the hierarchical properties.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013