public class IlrFunctionFactory
extends java.lang.Object
implements java.io.Serializable, ilog.rules.factory.IlrFunctionElement
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 and Description |
|---|
IlrFunctionFactory(IlrReflect reflect,
IlrPackageFactory pkg,
java.lang.String definitionName)
Constructs a function factory using a function name.
|
IlrFunctionFactory(IlrReflect reflect,
IlrPackageFactory pkg,
java.lang.String definitionName,
java.lang.Class returnType)
Constructs a function factory using a function name and its return type.
|
IlrFunctionFactory(java.lang.String definitionName,
IlrPackageFactory pkg,
IlrType returnType)
Constructs a function factory using a function name and its return type.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addArgument(IlrVariable argument)
Adds a formal argument to the function.
|
void |
addStatement(IlrStatement statement)
Adds an action to the function.
|
java.util.Enumeration |
enumerateArguments()
Gets an enumeration to visit all the arguments of the function.
|
java.util.Enumeration |
enumerateStatements()
Gets an enumeration to visit all the actions of the function.
|
static java.lang.String |
formatIdentifier(java.lang.String name,
java.lang.Class[] argtypes)
Formats a function identifier from its name and its argument.
|
static java.lang.String |
formatIdentifier(java.lang.String name,
IlrType[] argtypes)
Formats a function identifier from its name and its arguments.
|
static java.lang.String |
formatSignature(java.lang.String name,
java.lang.Class[] argtypes,
java.lang.Class returnType)
Formats a function signature using its name, its argument types, and
the return type.
|
static java.lang.String |
formatSignature(java.lang.String name,
IlrType[] argtypes,
IlrType returnType)
Formats a function signature using its name, its argument types, and
the return type.
|
static java.lang.String |
formatSignature(java.lang.String name,
java.lang.String[] argtypes,
java.lang.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.
|
java.lang.String |
getFormalComment()
Gets the formal comment of the function.
|
java.lang.String |
getIdentifier()
Gets the identifier of the function.
|
java.lang.String |
getName()
Gets the fully qualified name of the function.
|
IlrPackageFactory |
getPackage()
Returns the package in which the function is defined.
|
java.lang.String |
getShortName()
Gets the short name of the function.
|
java.lang.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(java.lang.String name)
Checks to see if the argument is already defined.
|
boolean |
isVoidFunction()
Tests if the function returns void.
|
boolean |
match(java.lang.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(java.lang.String formalComment)
Sets the formal comment of the function.
|
void |
setName(java.lang.String name)
Sets the fully qualified name of the function to the given parameter.
|
void |
setStatements(IlrStatement[] statements)
Sets the statements of the function.
|
public IlrFunctionFactory(IlrReflect reflect, IlrPackageFactory pkg, java.lang.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, java.lang.String definitionName, java.lang.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(java.lang.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.public java.lang.String getName()
public java.lang.String getShortName()
public void setName(java.lang.String name)
name - The name of the function.public java.lang.String getFormalComment()
public void setFormalComment(java.lang.String formalComment)
formalComment - The formal comment of the function.public IlrType getXOMReturnType()
public java.lang.String getIdentifier()
public java.lang.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(java.lang.Class[] callTypes)
callTypes - The argument types passed to the function.true if the function accepts the argument types.public final boolean hasArgument(java.lang.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 java.util.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 java.util.Enumeration enumerateStatements()
public static java.lang.String formatIdentifier(java.lang.String name,
IlrType[] argtypes)
name - The function name.argtypes - The argument types.public static java.lang.String formatIdentifier(java.lang.String name,
java.lang.Class[] argtypes)
name - The function name.argtypes - The argument types.public static java.lang.String formatSignature(java.lang.String name,
java.lang.String[] argtypes,
java.lang.String returnType)
name - The function name.argtypes - The argument types.returnType - The return type.public static java.lang.String formatSignature(java.lang.String name,
IlrType[] argtypes,
IlrType returnType)
name - The function name.argtypes - The argument types.returnType - The return type.public static java.lang.String formatSignature(java.lang.String name,
java.lang.Class[] argtypes,
java.lang.Class returnType)
name - The function name.argtypes - The argument types.returnType - The return type.public IlrPackageFactory getPackage()
© Copyright IBM Corp. 1987, 2017