public class StartsWithFunction extends java.lang.Object implements Function
4.2 boolean starts-with(string,string)
The starts-with function returns true if the first argument string starts with the second argument string, and otherwise returns false.
Constructor and Description |
---|
StartsWithFunction()
Create a new
StartsWithFunction object. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
call(Context context,
java.util.List args)
Returns true if the string-value of the first item in
args
starts with the string-value of the second item in args . |
static java.lang.Boolean |
evaluate(java.lang.Object strArg,
java.lang.Object matchArg,
Navigator nav)
Returns true if the string-value of
strArg
starts with the string-value of matchArg . |
public StartsWithFunction()
StartsWithFunction
object.public java.lang.Object call(Context context, java.util.List args) throws FunctionCallException
args
starts with the string-value of the second item in args
.
Otherwise it returns false.call
in interface Function
context
- the context at the point in the
expression when the function is calledargs
- a list that contains two itemsBoolean.TRUE
if the first item in args
starts with the string-value of the second item in args
;
otherwise Boolean.FALSE
FunctionCallException
- if args
does not have length twopublic static java.lang.Boolean evaluate(java.lang.Object strArg, java.lang.Object matchArg, Navigator nav)
strArg
starts with the string-value of matchArg
.
Otherwise it returns false.strArg
- the object whose string-value searched for the prefixmatchArg
- the object whose string-value becomes the prefix string to compare againstnav
- the navigator used to calculate the string-values of the argumentsBoolean.TRUE
if the string-value of strArg
starts with the string-value of matchArg
;
otherwise Boolean.FALSE