|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.comm.codec.bytebuffer.SegmenterUtil
public final class SegmenterUtil
Helper class for searching a byte sequence as a subsequence within another byte sequence.
| Nested Class Summary | |
|---|---|
static class |
SegmenterUtil.FoundToken
Represents the found token, i.e. its position and the index of the token that has been found. |
| Field Summary | |
|---|---|
static int |
NO_TOKEN
Special value for the token index, indicating that no token has been found. |
static int |
NOT_FOUND
Special value for the token position, indicating that no token has been found. |
| Method Summary | |
|---|---|
static int |
indexOf(byte[] token,
byte[] buffer)
Tries to find token as a subsequence within buffer and returns the token's position, or NOT_FOUND if the
token was not found. |
static int |
indexOf(byte[] token,
byte[] buffer,
int begin,
int end)
Tries to find token as a subsequence within buffer and returns the token's position, or NOT_FOUND if the
token was not found. |
static int |
indexOf(byte[] token,
ByteBuffer buffer)
Tries to find token as a subsequence within buffer and returns the token's position, or NOT_FOUND if the
token was not found. |
static int |
indexOf(byte[] token,
ByteBuffer buffer,
int begin,
int end)
Tries to find token as a subsequence within buffer and returns the token's position, or NOT_FOUND if the
token was not found. |
static SegmenterUtil.FoundToken |
indexOf(List<byte[]> tokens,
ByteBuffer buffer)
Tries to find one of the given tokens as a subsequence within buffer and returns the token's position and the token's index. |
static SegmenterUtil.FoundToken |
indexOf(List<byte[]> tokens,
ByteBuffer buffer,
int begin,
int end)
Tries to find one of the given tokens as a subsequence within buffer and returns the token's position and the token's index. |
static int |
indexOfTruncated(byte[] token,
ByteBuffer buffer)
Tries to find token as a subsequence within buffer and returns the token's position, or NOT_FOUND if the
token was not found. |
static int |
indexOfTruncated(byte[] token,
ByteBuffer buffer,
int begin,
int end)
Tries to find token as a subsequence within buffer and returns the token's position, or NOT_FOUND if the
token was not found. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NOT_FOUND
public static final int NO_TOKEN
| Method Detail |
|---|
public static int indexOf(byte[] token,
byte[] buffer)
NOT_FOUND if the
token was not found.
token - the tokenbuffer - the buffer
NOT_FOUND if the token was not found
public static int indexOf(byte[] token,
byte[] buffer,
int begin,
int end)
NOT_FOUND if the
token was not found. The search within the buffer is restricted to the range [begin,end).
token - the tokenbuffer - the bufferbegin - the beginning of the search interval defined as [begin,end)end - the end of the search interval defined as [begin,end)
NOT_FOUND if the token was not found
public static int indexOf(byte[] token,
ByteBuffer buffer)
NOT_FOUND if the
token was not found.
token - the tokenbuffer - the buffer
NOT_FOUND if the token was not found
public static int indexOf(byte[] token,
ByteBuffer buffer,
int begin,
int end)
NOT_FOUND if the
token was not found. The search within the buffer is restricted to the range [begin,end).
token - the tokenbuffer - the bufferbegin - the beginning of the search interval defined as [begin,end)end - the end of the search interval defined as [begin,end)
NOT_FOUND if the token was not found
public static SegmenterUtil.FoundToken indexOf(List<byte[]> tokens,
ByteBuffer buffer)
NOT_FOUND and NO_TOKEN.
tokens - the lost of tokens to search forbuffer - the buffer
NOT_FOUND and NOT_FOUND if the token was not found
public static SegmenterUtil.FoundToken indexOf(List<byte[]> tokens,
ByteBuffer buffer,
int begin,
int end)
NOT_FOUND and NO_TOKEN. The search within the buffer is
restricted to the range [begin,end).
tokens - the lost of tokens to search forbuffer - the bufferbegin - the beginning of the search interval defined as [begin,end)end - the end of the search interval defined as [begin,end)
NOT_FOUND and NOT_FOUND if the token was not found
public static int indexOfTruncated(byte[] token,
ByteBuffer buffer)
NOT_FOUND if the
token was not found. The token may also be found as a truncated version at the end of the buffer.
token - the tokenbuffer - the buffer
NOT_FOUND if the token was not found
public static int indexOfTruncated(byte[] token,
ByteBuffer buffer,
int begin,
int end)
NOT_FOUND if the
token was not found. The token may also be found as a truncated version at the end of the buffer. The search
within the buffer is restricted to the range [begin,end).
token - the tokenbuffer - the bufferbegin - the beginning of the search interval defined as [begin,end)end - the end of the search interval defined as [begin,end)
NOT_FOUND if the token was not found
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||