public class Signature
extends java.lang.Object
implements java.io.Externalizable
Modifier and Type | Field and Description |
---|---|
private BaseNativeType[] |
args
Argument list in left to right order, with one element for each argument.
|
private int |
error
If not
LibraryManager.ERROR_NONE , then this code describes the failure. |
private int |
platform
The platform type on which the client code is running.
|
private BaseNativeType |
retval
Return value (will not be
null if the function returns a value). |
Constructor and Description |
---|
Signature()
Default constructor.
|
Signature(int numArgs)
Create a new native function signature.
|
Modifier and Type | Method and Description |
---|---|
BaseNativeType |
getArgument(int idx)
Obtains a specific argument for this native function.
|
int |
getArgumentSize()
Reports the number of arguments for this native function.
|
int |
getErrorCode()
Obtains the constant that defines the error code from the invocation attempt.
|
int |
getPlatform()
Obtains the constant that defines the platform type on which the client is running.
|
BaseNativeType |
getReturnValue()
Obtains the descriptor for the return value.
|
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
void |
setArgument(BaseNativeType value,
int idx)
Assigns the argument to the given index position for this native function.
|
void |
setArgumentSize(int numArgs)
Defines the number of arguments for this native function.
|
void |
setErrorCode(int error)
Assigns the constant that defines the error code from the invocation attempt.
|
void |
setPlatform(int platform)
Assigns the constant that defines the platform type on which the client is running.
|
void |
setReturnValue(BaseNativeType retval)
Assigns the descriptor for the return value.
|
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
private BaseNativeType[] args
private BaseNativeType retval
null
if the function returns a value).private int platform
private int error
LibraryManager.ERROR_NONE
, then this code describes the failure.public Signature()
public Signature(int numArgs)
numArgs
- The non-negative number of arguments for the native function.java.lang.IllegalArgumentException
- If the number of arguments was specified as a negative number.public int getArgumentSize()
public void setArgumentSize(int numArgs)
numArgs
- The number of arguments (must always be 0 or more).java.lang.IllegalArgumentException
- If the number of arguments was specified as a negative number.public BaseNativeType getArgument(int idx)
idx
- The 0-based index number of the argument to obtain.null
if the argument has not yet been defined
but is within the valid range.java.lang.IllegalArgumentException
- If the argument index is out of range.public void setArgument(BaseNativeType value, int idx)
value
- The argument to assign. If this is null
, it effectively clears
the state for that index position.idx
- The 0-based index number of the argument to assign.java.lang.IllegalArgumentException
- If the argument index is out of range.public BaseNativeType getReturnValue()
null
if there is no defined return value.public void setReturnValue(BaseNativeType retval)
retval
- The descriptor to assign. If this is null
, it effectively clears
the state for the return value.public int getPlatform()
public void setPlatform(int platform)
platform
- The new client platform type.public int getErrorCode()
LibraryManager.ERROR_NONE
, then a failure has occurred and this code describes
the failure.public void setErrorCode(int error)
error
- The new error code. If this is not LibraryManager.ERROR_NONE
, then a
failure has occurred and this code describes the failure.public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The input source from which fields will be restored.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If payload can't be instantiated.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The output destination to which fields will be saved.java.io.IOException
- In case of I/O errors.