public class Translate extends SystemFunction implements Callable, StatefulSystemFunction
Constructor and Description |
---|
Translate() |
Modifier and Type | Method and Description |
---|---|
Sequence |
call(XPathContext context,
Sequence[] arguments)
Evaluate the expression
|
Translate |
copy()
Make a copy of this SystemFunction.
|
Expression |
fixArguments(Expression... arguments)
Allow the function to create an optimized call based on the values of the actual arguments
|
java.lang.String |
getCompilerName()
Get the (local) name of a class that can be used to generate bytecode for this
system function
|
IntToIntMap |
getStaticMap()
Get the translation map built at compile time if there is one
|
static java.lang.CharSequence |
translate(StringValue sv0,
StringValue sv1,
StringValue sv2)
Perform the translate function
|
static java.lang.CharSequence |
translateUsingMap(StringValue in,
IntToIntMap map)
Implement the translate() function using an index built at compile time
|
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, getArity, getCardinality, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, importAttributes, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, typeCheckCaller
atomize, deepEquals, effectiveBooleanValue, getAnnotations, getStringValue, getStringValueCS, isArray, isMap, makeNewContext, simplify, typeCheck
getLength, head, isStreamed, itemAt, iterate, reduce, subsequence
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLength, head, itemAt, reduce, subsequence
public Expression fixArguments(Expression... arguments)
fixArguments
in class SystemFunction
arguments
- the supplied arguments to the function callpublic IntToIntMap getStaticMap()
public static java.lang.CharSequence translate(StringValue sv0, StringValue sv1, StringValue sv2)
sv0
- the string to be translatedsv1
- the characters to be substitutedsv2
- the replacement characterspublic static java.lang.CharSequence translateUsingMap(StringValue in, IntToIntMap map)
in
- the string to be translatedmap
- index built at compile time, mapping input characters to output characters. The map returns
-1 for a character that is to be deleted from the input string, Integer.MAX_VALUE for a character that is
to remain intactpublic Sequence call(XPathContext context, Sequence[] arguments) throws XPathException
call
in interface Callable
call
in interface Function
context
- the dynamic evaluation contextarguments
- the values of the arguments, supplied as SequencesXPathException
- if a dynamic error occurs during the evaluation of the expressionpublic java.lang.String getCompilerName()
SystemFunction
getCompilerName
in class SystemFunction
public Translate copy()
copy
in interface StatefulSystemFunction
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.