public class Translate extends SystemFunction implements Callable
Constructor and Description |
---|
Translate() |
Modifier and Type | Method and Description |
---|---|
Sequence |
call(XPathContext context,
Sequence[] arguments)
Evaluate the expression
|
Expression |
fixArguments(Expression... arguments)
Allow the function to create an optimized call based on the values of the actual arguments
|
ExpressionCompiler |
getExpressionCompiler()
Return the compiler of the Translate expression
|
IntToIntMap |
getStaticMap()
Get the translation map built at compile time if there is one
|
static CharSequence |
translate(StringValue sv0,
StringValue sv1,
StringValue sv2)
Perform the translate function
|
static CharSequence |
translateUsingMap(StringValue in,
IntToIntMap map)
Implement the translate() function using an index built at compile time
|
equals, export, exportAttributes, getArity, getCardinality, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamingAdjunct, importAttributes, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, typeCheckCaller
atomize, deepEquals, effectiveBooleanValue, getStringValue, getStringValueCS, isArray, isMap, simplify, typeCheck
getLength, head, 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 CharSequence translate(StringValue sv0, StringValue sv1, StringValue sv2)
sv0
- the string to be translatedsv1
- the characters to be substitutedsv2
- the replacement characterspublic static 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 ExpressionCompiler getExpressionCompiler()
getExpressionCompiler
in class SystemFunction
Copyright (c) 2004-2017 Saxonica Limited. All rights reserved.