RETURN_T
- function's return typepublic abstract class FirstOrderFunctionSignature<RETURN_T extends Value> extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
isVarArgs
Is the last parameter specified in
paramTypes considered as variable-length (like Java Method.isVarArgs() ), i.e. |
protected String |
name |
protected Datatype<RETURN_T> |
returnType |
protected static IllegalArgumentException |
UNDEF_PARAMETER_TYPES_EXCEPTION |
Modifier | Constructor and Description |
---|---|
protected |
FirstOrderFunctionSignature(String name,
Datatype<RETURN_T> returnType,
boolean varArgs)
Creates function signature
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
Get function name
|
abstract List<? extends Datatype<?>> |
getParameterTypes()
Get function parameter types
|
Datatype<RETURN_T> |
getReturnType()
Get function return type
|
boolean |
isVarArgs()
Returns
true if this method was declared to take a variable number of arguments; returns false otherwise. |
String |
toString() |
protected static final IllegalArgumentException UNDEF_PARAMETER_TYPES_EXCEPTION
protected final String name
protected final boolean isVarArgs
paramTypes
considered as variable-length (like Java Method.isVarArgs()
), i.e. taking a variable number of arguments (0 or more) of the
specified paramTypes[n-1] with n the size of paramTypes). In the following examples, '...' means varargs like in Java:
Example 1: string-concat(string, string, string...) -> paramTypes={string, string, string}, isVarargs=true
Example 2: or(boolean...) -> paramTypes={boolean}, isVarargs=true (As you can see, isVarargs=true really means 0 or more args; indeed, the or function can take 0 parameter according to spec)
Example 3: n-of(integer, boolean...) -> paramTypes={integer, boolean}, isVarargs=true
Example 4: abs(integer) -> paramTypes={integer}, isVarargs=false
Example 5: string-equal(string, string) -> paramTypes={string, string}, isVarargs=false
Example 6: date-add-yearMonthDuration(date, yearMonthDuration) -> paramTypes={date, yearMonthDuration}, isVarargs=false
protected FirstOrderFunctionSignature(String name, Datatype<RETURN_T> returnType, boolean varArgs) throws IllegalArgumentException
name
- function name (e.g. XACML-defined URI)returnType
- function's return typevarArgs
- true iff the function takes a variable number of arguments (like Java Method.isVarArgs()
, i.e. the final type in paramTypes
can be repeated 0 or more times to
match a variable-length argument
Examples with varargs=true ('...' means varargs like in Java):
Example 1: string-concat(string, string, string...) -> paramTypes={string, string, string}
Example 2: or(boolean...) -> paramTypes={boolean} (As you can see, isVarargs=true really means 0 or more args; indeed, the or function can take 0 parameter according to spec)
Example 3: n-of(integer, boolean...) -> paramTypes={integer, boolean}
IllegalArgumentException
- if ( name == null || returnType == null
)public String getName()
public Datatype<RETURN_T> getReturnType()
public boolean isVarArgs()
true
if this method was declared to take a variable number of arguments; returns false
otherwise.true
iff this method was declared to take a variable number of arguments.public abstract List<? extends Datatype<?>> getParameterTypes()
Copyright © 2012–2020. All rights reserved.