public abstract class Collation extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
Collation.Mode
Search modes.
|
Constructor and Description |
---|
Collation() |
Modifier and Type | Method and Description |
---|---|
byte[] |
after(byte[] string,
byte[] sub,
InputInfo info)
Returns the substring after a specified string.
|
byte[] |
before(byte[] string,
byte[] sub,
InputInfo info)
Returns the substring before a specified string.
|
abstract int |
compare(byte[] string,
byte[] compare)
Compares two strings.
|
boolean |
contains(byte[] string,
byte[] sub,
InputInfo info)
Checks if a string is contained in another.
|
boolean |
endsWith(byte[] string,
byte[] sub,
InputInfo info)
Checks if a string ends with another.
|
static Collation |
get(byte[] uri,
QueryContext qc,
StaticContext sc,
InputInfo info,
QueryError err)
Returns a collation instance for the specified uri.
|
protected abstract int |
indexOf(String string,
String sub,
Collation.Mode mode,
InputInfo info)
Returns the start or end position of the specified substring.
|
boolean |
startsWith(byte[] string,
byte[] sub,
InputInfo info)
Checks if a string starts with another.
|
byte[] |
uri()
Returns the collation URI.
|
public static Collation get(byte[] uri, QueryContext qc, StaticContext sc, InputInfo info, QueryError err) throws QueryException
uri
- collation uriqc
- query contextsc
- static contextinfo
- input infoerr
- error code for unknown collation urisnull
for unicode point collationQueryException
- query exceptionpublic final boolean contains(byte[] string, byte[] sub, InputInfo info) throws QueryException
string
- stringsub
- substring to be foundinfo
- input infoQueryException
- query exceptionpublic final boolean startsWith(byte[] string, byte[] sub, InputInfo info) throws QueryException
string
- stringsub
- substring to be foundinfo
- input infoQueryException
- query exceptionpublic final boolean endsWith(byte[] string, byte[] sub, InputInfo info) throws QueryException
string
- stringsub
- substring to be foundinfo
- input infoQueryException
- query exceptionpublic final byte[] after(byte[] string, byte[] sub, InputInfo info) throws QueryException
string
- stringsub
- substring to be foundinfo
- input infoQueryException
- query exceptionpublic final byte[] before(byte[] string, byte[] sub, InputInfo info) throws QueryException
string
- stringsub
- substring to be foundinfo
- input infoQueryException
- query exceptionpublic final byte[] uri()
public abstract int compare(byte[] string, byte[] compare)
string
- stringcompare
- string to be comparedprotected abstract int indexOf(String string, String sub, Collation.Mode mode, InputInfo info) throws QueryException
string
- stringsub
- substring to be foundmode
- search modeinfo
- input infoQueryException
- query exceptionCopyright © 2005–2015 BaseX Team. All rights reserved.