|
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.factory.IlrFunctionFactory
public class IlrFunctionFactory
Function definition of the rule language.
Warning: Serialized objects of this class will not be compatible with future releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of IBM Decision Server.
Constructor Summary | |
---|---|
IlrFunctionFactory(IlrReflect reflect,
IlrPackageFactory pkg,
String definitionName)
Constructs a function factory using a function name. |
|
IlrFunctionFactory(IlrReflect reflect,
IlrPackageFactory pkg,
String definitionName,
Class returnType)
Constructs a function factory using a function name and its return type. |
|
IlrFunctionFactory(String definitionName,
IlrPackageFactory pkg,
IlrType returnType)
Constructs a function factory using a function name and its return type. |
Method Summary | |
---|---|
void |
addArgument(IlrVariable argument)
Adds a formal argument to the function. |
void |
addStatement(IlrStatement statement)
Adds an action to the function. |
Enumeration |
enumerateArguments()
Gets an enumeration to visit all the arguments of the function. |
Enumeration |
enumerateStatements()
Gets an enumeration to visit all the actions of the function. |
static String |
formatIdentifier(String name,
Class[] argtypes)
Formats a function identifier from its name and its argument. |
static String |
formatIdentifier(String name,
IlrType[] argtypes)
Formats a function identifier from its name and its arguments. |
static String |
formatSignature(String name,
Class[] argtypes,
Class returnType)
Formats a function signature using its name, its argument types, and the return type. |
static String |
formatSignature(String name,
IlrType[] argtypes,
IlrType returnType)
Formats a function signature using its name, its argument types, and the return type. |
static String |
formatSignature(String name,
String[] argtypes,
String returnType)
Formats a function signature using its name, its argument types, and the return type. |
int |
getArgumentCount()
Gets the number of arguments in the function. |
IlrVariable[] |
getArguments()
Gets the arguments of the function. |
String |
getFormalComment()
Gets the formal comment of the function. |
String |
getIdentifier()
Gets the identifier of the function. |
String |
getName()
Gets the fully qualified name of the function. |
IlrPackageFactory |
getPackage()
Returns the package in which the function is defined. |
String |
getShortName()
Gets the short name of the function. |
String |
getSignature()
Gets the signature of the function. |
int |
getStatementCount()
Gets the number of actions. |
IlrStatement[] |
getStatements()
Gets the actions of the function. |
IlrType |
getXOMReturnType()
Gets the return type of the function. |
boolean |
hasArgument(String name)
Checks to see if the argument is already defined. |
boolean |
isVoidFunction()
Tests if the function returns void. |
boolean |
match(Class[] callTypes)
Tests if the function accepts the types of arguments. |
boolean |
match(IlrValue[] arguments)
Tests if the function accepts the values as arguments. |
void |
removeArgument(IlrVariable argument)
Removes a formal argument from the rule. |
void |
removeStatement(IlrStatement statement)
Removes a statement from the rule. |
void |
setArguments(IlrVariable[] arguments)
Sets the arguments of the function. |
void |
setFormalComment(String formalComment)
Sets the formal comment of the function. |
void |
setName(String name)
Sets the fully qualified name of the function to the given parameter. |
void |
setStatements(IlrStatement[] statements)
Sets the statements of the function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IlrFunctionFactory(IlrReflect reflect, IlrPackageFactory pkg, String definitionName)
null
,
the function is
considered to belong to the default package.
The argument list initially is empty. The function returns void.
reflect
- A reflect.pkg
- The package to which the function belongs.definitionName
- The name of the function.public IlrFunctionFactory(IlrReflect reflect, IlrPackageFactory pkg, String definitionName, Class returnType)
null
, the
function is
considered to belong to the default package.
The argument list initially is empty.
reflect
- A reflect.pkg
- The package to which the function belongs.definitionName
- The name of the function.returnType
- The return type of the function.public IlrFunctionFactory(String definitionName, IlrPackageFactory pkg, IlrType returnType)
null
, the
function is
considered to belong to the default package.
The argument list initially is empty.
definitionName
- The name of the function.pkg
- The package to which the function belongs.returnType
- The return type of the function.Method Detail |
---|
public String getName()
public String getShortName()
public void setName(String name)
name
- The name of the function.public String getFormalComment()
public void setFormalComment(String formalComment)
formalComment
- The formal comment of the function.public IlrType getXOMReturnType()
public String getIdentifier()
public String getSignature()
public boolean isVoidFunction()
true
if the function return type
is a void type.public boolean match(IlrValue[] arguments)
arguments
- The arguments passed to the function.
true
if the function accepts the arguments.public boolean match(Class[] callTypes)
callTypes
- The argument types passed to the function.
true
if the function accepts the argument types.public final boolean hasArgument(String name)
name
- The argument to be checked.public final void addArgument(IlrVariable argument)
argument
- The argument to be added.public final void removeArgument(IlrVariable argument)
argument
- The argument to be removed.public final int getArgumentCount()
public final IlrVariable[] getArguments()
IlrVariable
representing
the arguments.public final void setArguments(IlrVariable[] arguments)
arguments
- The arguments to be set.public final Enumeration enumerateArguments()
public final void addStatement(IlrStatement statement)
statement
- The action to be added.public final void removeStatement(IlrStatement statement)
statement
- The statement to be removed.public final int getStatementCount()
public final IlrStatement[] getStatements()
public final void setStatements(IlrStatement[] statements)
statements
- The statements to be set.public final Enumeration enumerateStatements()
public static String formatIdentifier(String name, IlrType[] argtypes)
name
- The function name.argtypes
- The argument types.
public static String formatIdentifier(String name, Class[] argtypes)
name
- The function name.argtypes
- The argument types.
public static String formatSignature(String name, String[] argtypes, String returnType)
name
- The function name.argtypes
- The argument types.returnType
- The return type.
public static String formatSignature(String name, IlrType[] argtypes, IlrType returnType)
name
- The function name.argtypes
- The argument types.returnType
- The return type.
public static String formatSignature(String name, Class[] argtypes, Class returnType)
name
- The function name.argtypes
- The argument types.returnType
- The return type.
public IlrPackageFactory getPackage()
|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |