|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.util.IlrSelector
public class IlrSelector
Reflective selector.
To implement a selector, implement a accepts(<the class to accept>)
method
returning a boolean for each class to be visited. This selector implementation is generic,
and thus you can write the accepts method only for the classes you are interested in.
Also, it supports inheritance by applying the most specific accepts method that is provided.
If there is no implementation of the accepts method for the current object's class,
the accepts(Object)
method will be called. By default it returns false
.
To use this selector, call the isAccepted
method on the object you want to test.
Nested Class Summary | |
---|---|
static class |
IlrSelector.And
And selector, a selector that accepts an object if both underlying selectors accept it. |
static class |
IlrSelector.Not
Not selector, a selector that accepts the objects refused by an underlying selector. |
static class |
IlrSelector.Or
Or selector, a selector that accepts an object if one of the two underlying selectors accepts it. |
Constructor Summary | |
---|---|
IlrSelector()
|
Method Summary | |
---|---|
boolean |
accepts(Object o)
Default accepts method called whenever there is none more precise. |
boolean |
areAccepted(Collection collection)
Method to call to test the acceptance of each element of a collection. |
boolean |
isAccepted(Object o)
Tests if an object is acceptable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IlrSelector()
Method Detail |
---|
public boolean areAccepted(Collection collection)
collection
- A collection. It can be null. In this case, the method returns true.
True
if the parameter is null, empty
or all its objects are accepted.public boolean isAccepted(Object o)
o
- The object to test. If it is null, this method returns false
.
True
if the object is accepted, or False
if the object is null or not accepted.public boolean accepts(Object o)
false
but can be redefined.
o
-
|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |