- All Known Implementing Classes:
Argument
,BigIntArgument
,ByteArgument
,ByteArrayArgument
,NumericArgument
,SingleItem
,StringArgument
,TypedArgument
public interface Parameter
Interface for parameters stored in a
ParameterBuffer
.- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionvoid
copyTo
(ParameterBuffer buffer, Encoding stringEncoding) Copies this argument into the supplied buffer, uses the suppliedEncoding
for string arguments.int
getType()
The type identifier of the parameter (usually one of the constant values inISCConstants
).int
The value of the parameter as int.long
The value of the parameter as long.The value of the parameter as String.
-
Method Details
-
getType
int getType()The type identifier of the parameter (usually one of the constant values inISCConstants
).- Returns:
- The type of the parameter
-
getValueAsString
String getValueAsString()The value of the parameter as String.The implementation may throw a RuntimeException if the parameter isn't a string (or shouldn't be used as a string).
- Returns:
- The value as string
-
getValueAsInt
int getValueAsInt()The value of the parameter as int.The implementation may throw a RuntimeException if the parameter isn't an int (or shouldn't be used as an int).
- Returns:
- The value as int
-
getValueAsLong
long getValueAsLong()The value of the parameter as long.The implementation may throw a RuntimeException if the parameter isn't a long (or shouldn't be used as a long).
- Returns:
- The value as long
-
copyTo
Copies this argument into the supplied buffer, uses the suppliedEncoding
for string arguments.An instance of
Parameter
should know how to copy itself into another buffer (eg an instance ofStringArgument
would know to callParameterBuffer.addArgument(int, String, Encoding)
).The parameter does not need to check if it is the right type of destination buffer (if someone tries to add a TPB argument to a DPB they are free to try that).
- Parameters:
buffer
- ParameterBuffer instancestringEncoding
- Encoding to use for string properties. A value ofnull
can be used to signal that the original encoding should be used.
-