ilog.rules.brl.util

Class IlrPropertyManager

  • java.lang.Object
    • ilog.rules.brl.util.IlrPropertyManager
  • Direct Known Subclasses:
    IlrBRLSemanticContextExtension, IlrSyntaxTree.Node


    public class IlrPropertyManager
    extends java.lang.Object
    This class implements a mechanism of properties that allows storing of custom properties key/value on objects. As properties are stored in a linked list to minimize the memory footprint, this class cannot handle efficiently a large set of properties. This class can manage indexed properties.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  IlrPropertyManager.Property
      This class represents a property.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Object getProperty(java.lang.String propertyName)
      This method returns the value associated with the property.
      java.lang.Object getProperty(java.lang.String propertyName, int index)
      This method returns the value associated with the given indexed property.
      boolean hasProperty(java.lang.String propertyName)
      This method checks if a property is present on the object.
      boolean hasProperty(java.lang.String propertyName, int index)
      This method checks if an indexed property is present on the object.
      java.util.Iterator properties()
      This method returns an iterator on the properties registered on the object.
      void removeAllProperties()
      This method removes all properties stored on the object.
      boolean removeProperty(java.lang.String key)
      This method removes a property from the object.
      boolean removeProperty(java.lang.String key, int index)
      This method removes an indexed property from the object
      void setProperty(java.lang.String propertyName, int index, java.lang.Object value)
      This method allows setting an indexed property on the object.
      void setProperty(java.lang.String propertyName, java.lang.Object value)
      This method allows setting a property on the object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IlrPropertyManager

        public IlrPropertyManager()
    • Method Detail

      • setProperty

        public void setProperty(java.lang.String propertyName,
                                java.lang.Object value)
        This method allows setting a property on the object.
        Parameters:
        propertyName - The property key.
        value - The property value.
      • setProperty

        public void setProperty(java.lang.String propertyName,
                                int index,
                                java.lang.Object value)
        This method allows setting an indexed property on the object.
        Parameters:
        propertyName - The property key.
        index - The index of the property. A -1 index is equivalent to a non-indexed property.
        value - The property value.
      • removeAllProperties

        public void removeAllProperties()
        This method removes all properties stored on the object.
      • hasProperty

        public boolean hasProperty(java.lang.String propertyName)
        This method checks if a property is present on the object.
        Parameters:
        propertyName - The property key.
        Returns:
        true if the property is registered on the object, and false otherwise.
      • hasProperty

        public boolean hasProperty(java.lang.String propertyName,
                                   int index)
        This method checks if an indexed property is present on the object.
        Parameters:
        propertyName - The property key.
        index - The property index. A -1 index is equivalent to a non-indexed property.
        Returns:
        true if the property is registered on the object, or false if it is not.
      • getProperty

        public java.lang.Object getProperty(java.lang.String propertyName)
        This method returns the value associated with the property.
        Parameters:
        propertyName - The property key.
        Returns:
        The value associated with the property, or null if the property is not registered on the object.
      • getProperty

        public java.lang.Object getProperty(java.lang.String propertyName,
                                            int index)
        This method returns the value associated with the given indexed property.
        Parameters:
        propertyName - The property key.
        index - The index of the property. A -1 index is equivalent to a non-indexed property.
        Returns:
        The value associated with the property or null if the property is not registered on the object.
      • removeProperty

        public boolean removeProperty(java.lang.String key)
        This method removes a property from the object.
        Parameters:
        key - The property key.
        Returns:
        true if the property was found, or false if it was not.
      • removeProperty

        public boolean removeProperty(java.lang.String key,
                                      int index)
        This method removes an indexed property from the object
        Parameters:
        key - The property key.
        index - The property index. A -1 index is equivalent to a non-indexed property.
        Returns:
        true if the property was found, or false if it was not.
      • properties

        public java.util.Iterator properties()
        This method returns an iterator on the properties registered on the object. The objects returned by the iterator are instances of the IlrPropertyManager.Property class.
        Returns:
        A new iterator.

© Copyright IBM Corp. 1987, 2021