Package com.hexaly.modeler
Class HxmFunction
java.lang.Object
com.hexaly.modeler.HxmFunction
- All Implemented Interfaces:
AutoCloseable
A function can be either user-defined function or built-in function. It is
possible to create external functions from the modeler API and call them in
the modeler. See
HxmFunctor for more information on how to create
external functions. Functions are also used to represent the various methods
of modeler classes.- Since:
- 10.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionasValue()Gets the HxmFunction as HxmValue.call()Calls the function with no argument.Calls the function with the provided arguments.Calls the function with the provided arguments.Calls the function with no argument on the given object.Calls the function with the provided arguments on the given object.Calls the function with the provided arguments on the given object.voidclose()Releases the reference.booleanGets the name of the function.inthashCode()
-
Method Details
-
close
public void close()Releases the reference. If this function was already released, returns immediately and does nothing. Invoking any method on this object after this operation will throw an exception.
Note: Releasing a reference does not necessarily imply that the underlying function object is destroyed. It is only destroyed if no more references point to it.
- Specified by:
closein interfaceAutoCloseable- Since:
- 11.5
-
getDeclaredName
Gets the name of the function. The name of the function does not necessarily reflect the name of the variable(s) to which the function is associated. The name is mainly used to identify the function in stack traces when exceptions occur. -
callThis
Calls the function with no argument on the given object. Within the function, the "this" variable will be initialized to the supplied object.- Parameters:
self- The value to be used as the "this" variable.- Returns:
- Return value of the call.
- Since:
- 13.0
- See Also:
-
call
Calls the function with no argument. The call is not bound to an object. Consequently, the "this" variable will be nil within the function.- Returns:
- Return value of the call.
- See Also:
-
callThis
Calls the function with the provided arguments on the given object. Within the function, the "this" variable will be initialized to the supplied object.- Parameters:
self- The value to be used as the "this" variable.arguments- List of arguments.- Returns:
- Return value of the call.
- Since:
- 13.0
- See Also:
-
call
Calls the function with the provided arguments. The call is not bound to an object. Consequently, the "this" variable will be nil within the function.- Parameters:
arguments- List of arguments.- Returns:
- Return value of the call.
- See Also:
-
callThis
Calls the function with the provided arguments on the given object. Within the function, the "this" variable will be initialized to the supplied object.- Parameters:
self- The value to be used as the "this" variable.arguments- List of arguments.- Returns:
- Return value of the call.
- Since:
- 13.0
- See Also:
-
call
Calls the function with the provided arguments. The call is not bound to an object. Consequently, the "this" variable will be nil within the function.- Parameters:
arguments- List of arguments- Returns:
- Return value of the call.
- See Also:
-
asValue
Gets the HxmFunction as HxmValue.- See Also:
-
hashCode
public int hashCode() -
equals
-