Rule Execution Server API

ilog.rules.bom.util
Class IlrSelectors

java.lang.Object
  extended by ilog.rules.bom.util.IlrSelectors

public class IlrSelectors
extends Object

This is a utility class which has miscellaneous static methods which combine given selectors to produce a new selector, or apply a given selector to an iterator or to a list producing a new filtered iterator.

This class also provides some predefined selectors accessible through static fields.


Field Summary
static IlrSelector AllElements
          A selector which does not filter out any element.
static IlrSelector DynamicClasses
          A selector which filters out non dynamic classes (classes for which the IlrType.getNativeClass() method returns null).
static IlrSelector InterfaceClasses
          A selector which filters out non interface classes (classes for which the IlrClass.isInterface() method returns false).
static IlrSelector StaticMembers
          A selector which filters out non static members (members for which the IlrMember.isStatic method returns false).
 
Constructor Summary
IlrSelectors()
           
 
Method Summary
static Iterator dynamicTypes(IlrObjectModel objectModel)
          This static method returns an iterator over the dynamic types of the given object model.
static Iterator dynamicTypes(Iterator typeIter)
          This static method filters the elements of the given iterator.
static Iterator Select(Iterator iter, IlrSelector selector)
          This static method filters the elements of a given iterator.
static Iterator Select(List list, IlrSelector selector)
          This static method filters the elements of a given list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AllElements

public static final IlrSelector AllElements
A selector which does not filter out any element. It serves as a default selector.


StaticMembers

public static final IlrSelector StaticMembers
A selector which filters out non static members (members for which the IlrMember.isStatic method returns false).


InterfaceClasses

public static final IlrSelector InterfaceClasses
A selector which filters out non interface classes (classes for which the IlrClass.isInterface() method returns false).


DynamicClasses

public static final IlrSelector DynamicClasses
A selector which filters out non dynamic classes (classes for which the IlrType.getNativeClass() method returns null).

Constructor Detail

IlrSelectors

public IlrSelectors()
Method Detail

dynamicTypes

public static Iterator dynamicTypes(Iterator typeIter)
This static method filters the elements of the given iterator. It returns an iterator over a subset of these elements : those which represent dynamic types (as opposed to Java classes). The dynamic types are those for which the IlrType.getNativeClass() method returns null.

Parameters:
typeIter - an iterator over types.
Returns:
an iterator over those elements of typeIter which are not bound to an actual Java class.

dynamicTypes

public static Iterator dynamicTypes(IlrObjectModel objectModel)
This static method returns an iterator over the dynamic types of the given object model. The dynamic types are those for which the IlrType.getNativeClass() method returns null.

Parameters:
objectModel - an object model.
Returns:
an iterator over those types of objectModel which are not bound to an actual Java class.

Select

public static Iterator Select(Iterator iter,
                              IlrSelector selector)
This static method filters the elements of a given iterator. It returns an iterator over a subset of these elements : those which satisfy the given selector.

Parameters:
iter - an iterator over model elements
selector - a selector which will be used to filter the elements of the iter parameter
Returns:
an iterator over those elements of iter which satisfy the selector

Select

public static Iterator Select(List list,
                              IlrSelector selector)
This static method filters the elements of a given list. It returns an iterator over a subset of these elements : those which satisfy the given selector.

Parameters:
list - an list of model elements
selector - a selector which will be used to filter the elements of the list parameter
Returns:
an iterator over those elements of list which satisfy the selector

Rule Execution Server API

© Copyright IBM Corp. 1987, 2012