public class Translate extends SystemFunction implements Callable
Modifier and Type | Class and Description |
---|---|
static class |
Translate.TranslateFixed |
Constructor and Description |
---|
Translate() |
Modifier and Type | Method and Description |
---|---|
Sequence |
call(XPathContext context,
Sequence[] arguments)
Evaluate the expression
|
ExpressionCompiler |
getExpressionCompiler()
Return the compiler of the Translate expression
|
IntToIntMap |
getStaticMap()
Get the translation map built at compile time if there is one
|
Expression |
makeOptimizedFunctionCall(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo,
Expression... arguments)
Allow the function to create an optimized call based on the values of the actual arguments
|
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, makeCall, makeFunction, makeFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, typeCheckCaller
atomize, deepEquals, effectiveBooleanValue, getStringValue, getStringValueCS, isArray, isMap, optimize, 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 makeOptimizedFunctionCall(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo, Expression... arguments) throws XPathException
makeOptimizedFunctionCall
in class SystemFunction
visitor
- the expression visitorcontextInfo
- information about the context itemarguments
- the supplied arguments to the function callXPathException
- if an error is detectedpublic 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-2014 Saxonica Limited. All rights reserved.