Package org.basex.query.util.collation
Class Collation
java.lang.Object
org.basex.query.util.collation.Collation
This class organizes collations.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal byte[]Returns the substring after a specified string.final byte[]Returns the substring before a specified string.abstract intcompare(byte[] string, byte[] compare) Compares two strings.final booleanChecks if a string is contained in another.final booleanChecks if a string ends with another.static Collationget(byte[] uri, QueryContext qc, StaticContext sc, InputInfo ii, QueryError err) Returns a collation instance for the specified uri.protected abstract intindexOf(String string, String sub, Collation.Mode mode, InputInfo info) Returns the start or end position of the specified substring.final booleanstartsWith(byte[] string, byte[] sub, InputInfo ii) Checks if a string starts with another.final byte[]uri()Returns the collation URI.
-
Constructor Details
-
Collation
public Collation()
-
-
Method Details
-
get
public static Collation get(byte[] uri, QueryContext qc, StaticContext sc, InputInfo ii, QueryError err) throws QueryException Returns a collation instance for the specified uri.- Parameters:
uri- collation uriqc- query contextsc- static contextii- input infoerr- error code for unknown collation uris- Returns:
- collator instance or
nullfor unicode point collation - Throws:
QueryException- query exception
-
contains
Checks if a string is contained in another.- Parameters:
string- stringsub- substring to be foundii- input info- Returns:
- result of check
- Throws:
QueryException- query exception
-
startsWith
Checks if a string starts with another.- Parameters:
string- stringsub- substring to be foundii- input info- Returns:
- result of check
- Throws:
QueryException- query exception
-
endsWith
Checks if a string ends with another.- Parameters:
string- stringsub- substring to be foundii- input info- Returns:
- result of check
- Throws:
QueryException- query exception
-
after
Returns the substring after a specified string.- Parameters:
string- stringsub- substring to be foundii- input info- Returns:
- substring
- Throws:
QueryException- query exception
-
before
Returns the substring before a specified string.- Parameters:
string- stringsub- substring to be foundii- input info- Returns:
- substring
- Throws:
QueryException- query exception
-
uri
public final byte[] uri()Returns the collation URI.- Returns:
- uri
-
compare
public abstract int compare(byte[] string, byte[] compare) Compares two strings.- Parameters:
string- stringcompare- string to be compared- Returns:
- result of check
-
indexOf
protected abstract int indexOf(String string, String sub, Collation.Mode mode, InputInfo info) throws QueryException Returns the start or end position of the specified substring.- Parameters:
string- stringsub- substring to be foundmode- search modeinfo- input info- Returns:
- string index
- Throws:
QueryException- query exception
-