org.deri.iris.builtins.string
Class StringSubstringAfterBuiltin
java.lang.Object
org.deri.iris.builtins.AbstractBuiltin
org.deri.iris.builtins.FunctionalBuiltin
org.deri.iris.builtins.string.StringSubstringAfterBuiltin
- All Implemented Interfaces:
- Comparable<IAtom>, IAtom, IBuiltinAtom
public class StringSubstringAfterBuiltin
- extends FunctionalBuiltin
Represents the RIF built-in func:substring-after as described in
http://www.w3.org/TR/xpath-functions/#func-substring-after. At the moment
only Unicode code point collation
(http://www.w3.org/2005/xpath-functions/collation/codepoint) is supported.
StringSubstringAfterBuiltin
public StringSubstringAfterBuiltin(ITerm... terms)
- Constructor.
- Parameters:
terms - The terms, where the term at the first position is the
haystack, the term at the second position is the
needle, the term at the third position is the
collation and the term at the last position represents the
result. The haystack is the string being searched
for the occurrence of the needle. The
needle is the string to be searched for in the
haystack.
- Throws:
IllegalArgumentException - if one of the terms is null
computeResult
protected ITerm computeResult(ITerm[] terms)
throws EvaluationException
- Description copied from class:
FunctionalBuiltin
- Computes the result when all terms but the term at the last position are
known.
- Specified by:
computeResult in class FunctionalBuiltin
- Parameters:
terms - The terms, where the terms at the last position is a
variable representing the result.
- Returns:
- The computed term, or
null if the operation is
unsuccessful.
- Throws:
EvaluationException - If an error occurs.
substring
public static String substring(String haystack,
String needle,
String collation)