public class RangeUtil extends Object
RangeStriper
and RangeFilter
.RangeFilter.SYMBOL_PATTERN
Modifier and Type | Field and Description |
---|---|
static int |
CODE_LENGTH |
Modifier and Type | Method and Description |
---|---|
static int |
compareByString(char[] s1,
String s2,
int s2from)
Utility method to compare two strings: one as a char array and another one as a substring.
|
static long |
encodeSymbol(char[] s,
int from,
int to) |
static long |
encodeSymbol(String s)
Encode the given symbol into the primitive long value.
|
static long |
encodeSymbol(String s,
int from,
int to)
Encode the given symbol into the primitive long value.
|
static boolean |
isValidRangeChar(char c)
|
static int |
skipPrefix(char[] symbol,
int from,
int to) |
static long |
skipPrefix(long symbolCode)
Returns encoded string value stripped from unused prefix.
|
static int |
skipPrefix(String symbol)
Returns index in the string of the symbol stripped from unused prefix.
|
static int |
skipPrefix(String symbol,
int length)
Returns index in the string of the symbol stripped from unused prefix.
|
public static final int CODE_LENGTH
public static long encodeSymbol(String s)
CODE_LENGTH
characters will be encoded.s
- symbolencodeSymbol(String, int, int)
public static long encodeSymbol(String s, int from, int to)
CODE_LENGTH
characters within the given bounds will be encoded.s
- symbolfrom
- the beginning index, inclusiveto
- the ending index, exclusiveSymbolCodec.decodeToLong(int)
public static long encodeSymbol(char[] s, int from, int to)
public static int compareByString(char[] s1, String s2, int s2from)
s1
- string represented as a char arrays2
- string to get a substring froms2from
- index to get a substring fromString.compareTo(String)
public static boolean isValidRangeChar(char c)
c
- charactertrue
if the given char is a valid range charpublic static long skipPrefix(long symbolCode)
symbolCode
- symbol encoded as a long valueRangeFilter.SYMBOL_PATTERN
public static int skipPrefix(String symbol)
symbol
- symbol stringRangeFilter.SYMBOL_PATTERN
public static int skipPrefix(String symbol, int length)
symbol
- symbol stringlength
- symbol lengthRangeFilter.SYMBOL_PATTERN
public static int skipPrefix(char[] symbol, int from, int to)
Copyright © 2002–2025 Devexperts LLC. All rights reserved.