Rule Execution Server API

ilog.rules.factory
Class IlrCollectInSourceValue

java.lang.Object
  extended by ilog.rules.factory.IlrValue
      extended by ilog.rules.factory.IlrCollectInSourceValue
All Implemented Interfaces:
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 Summary
IlrCollectInSourceValue(IlrValue container, IlrType collectedType, String clause, IlrValue source)
          Builds an object collection from a specified type.
 
Method Summary
 Enumeration enumerateCollectionBindings()
          Returns the bindings declared in the collection tests.
 Enumeration enumerateCollectionTests()
          Returns the tests that the collection containing the collected objects must verify.
 Enumeration enumerateObjectBindings()
          Returns the bindings declared in the object tests.
 Enumeration enumerateObjectTests()
          Returns the tests the collected objects must satisfy.
 Object exploreValue(IlrFactoryExplorer explorer)
          Explores this constant value using a factory explorer and returns an object as a result.
 String getClause()
          Returns the clause used to tell how the source is covered.
 IlrValue getContainer()
          Returns the value that defines the container of collected objects.
 IlrValue getSource()
          Returns the value representing the source in which the objects to collect are found.
 IlrType getXOMCollectedType()
          Gets the class type of the collected objects.
 void setBindings(List objectBindings, List collectionBindings)
          Sets the variable bindings used in the object tests and in the collection tests.
 void setTests(List objectTests, List collectionTests)
          Sets the tests that the collected objects must satisfy and the tests that the collection (containing the collected objects) must satisfy.
 
Methods inherited from class ilog.rules.factory.IlrValue
add, divide, getField, getReflect, getType, getXOMType, invokeEquals, isConstant, isEvent, isEventCondition, isNull, multiply, remainder, subtract, testAfter, testAfter, testBefore, testBefore, testEqual, testFalse, testGreaterOrEqual, testGreaterThan, testIn, testInstanceOf, testLessOrEqual, testLessThan, testNotEqual, testNotIn, testOccursin, testTrue, timeof, toNegative, toPositive, toPostfixDecr, toPostfixIncr, toPrefixDecr, toPrefixIncr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlrCollectInSourceValue

public IlrCollectInSourceValue(IlrValue container,
                               IlrType collectedType,
                               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(List objectTests,
                     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(List objectBindings,
                        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 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 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 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 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 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 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.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013