ilog.rules.factory

Class IlrCollectInSourceValue

  • All Implemented Interfaces:
    java.io.Serializable


    public class IlrCollectInSourceValue
    extends IlrValue
    An expression collecting all objects of a specified class from a given source that verify specified tests.
    See Also:
    Serialized Form
    • Constructor Detail

      • IlrCollectInSourceValue

        public IlrCollectInSourceValue(IlrValue container,
                               IlrType collectedType,
                               java.lang.String clause,
                               IlrValue source)
        Builds an object collection from a specified type. A container to store the collected objects can be specified. The collected objects are found in a given source. The clause argument should be one of the predefined keywords: "from" or "in", or else an IllegalArgumentException is thrown.
        Parameters:
        container - A container in which the collected objects are stored. If no specific container is given, a default one is created.
        collectedType - The type of the objects we are collecting.
        clause - Can be "from" or "in".
        source - The source in which the objects to be collected are found.
    • Method Detail

      • setTests

        public void setTests(java.util.List objectTests,
                    java.util.List collectionTests)
        Sets the tests that the collected objects must satisfy and the tests that the collection (containing the collected objects) must satisfy.
        Parameters:
        objectTests - The tests the collected objects must verify.
        collectionTests - The tests the resulting collection must verify.
      • setBindings

        public void setBindings(java.util.List objectBindings,
                       java.util.List collectionBindings)
        Sets the variable bindings used in the object tests and in the collection tests.
        Parameters:
        objectBindings - The bindings declared in the tests on the collected objects.
        collectionBindings - The bindings declared in the tests on the resulting collection.
      • enumerateObjectBindings

        public final java.util.Enumeration enumerateObjectBindings()
        Returns the bindings declared in the object tests.
        Returns:
        An enumeration containing the bindings defined in the tests that the collected objects must verify.
      • enumerateObjectTests

        public final java.util.Enumeration enumerateObjectTests()
        Returns the tests the collected objects must satisfy.
        Returns:
        An enumeration containing the tests that the collected objects must verify.
      • enumerateCollectionBindings

        public final java.util.Enumeration enumerateCollectionBindings()
        Returns the bindings declared in the collection tests.
        Returns:
        An enumeration containing the bindings defined in the tests that the resulting collection must verify.
      • enumerateCollectionTests

        public final java.util.Enumeration enumerateCollectionTests()
        Returns the tests that the collection containing the collected objects must verify.
        Returns:
        An enumeration that contains the tests that the resulting collection must verify.
      • getContainer

        public IlrValue getContainer()
        Returns the value that defines the container of collected objects.
        Returns:
        A value that represents the container in which the collected objects are stored.
      • getXOMCollectedType

        public final IlrType getXOMCollectedType()
        Gets the class type of the collected objects.
        Returns:
        The class type of the collected objects.
      • getClause

        public java.lang.String getClause()
        Returns the clause used to tell how the source is covered. The possible values are "from" or "in".
        Returns:
        Either "from" or "in".
      • getSource

        public IlrValue getSource()
        Returns the value representing the source in which the objects to collect are found.
        Returns:
        The source where the objects to collect are found.
      • exploreValue

        public java.lang.Object exploreValue(IlrFactoryExplorer explorer)
        Explores this constant value using a factory explorer and returns an object as a result.
        Specified by:
        exploreValue in class IlrValue
        Parameters:
        explorer - The factory explorer.
        Returns:
        An object that represents the result of the exploration, or null if the method does not return a value.

© Copyright IBM Corp. 1987, 2017