public class ByteTree<T> extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
ByteTree.EndMatcher |
private class |
ByteTree.VirtualByteTree |
| 限定符和类型 | 字段和说明 |
|---|---|
private T |
attach
捆绑附件对象
|
private int |
depth |
private static int |
MAX_DEPTH |
private ByteTree<T>[] |
nodes |
private static ByteTree.EndMatcher |
NULL_END_MATCHER |
private ByteTree<T> |
parent |
private int |
shift |
protected String |
stringValue |
private byte |
value |
| 限定符和类型 | 方法和说明 |
|---|---|
private ByteTree<T> |
addNode(byte[] value,
int offset,
int limit,
ByteTree.EndMatcher endMatcher) |
void |
addNode(String value)
从根节点开始,为入参字符串创建节点
|
void |
addNode(String value,
T attach) |
T |
getAttach() |
int |
getDepth() |
String |
getStringValue() |
private void |
increase(int size) |
ByteTree<T> |
search(byte[] bytes,
int offset,
int len,
ByteTree.EndMatcher endMatcher) |
ByteTree<T> |
search(byte[] bytes,
int offset,
int limit,
ByteTree.EndMatcher endMatcher,
boolean cache)
从给定的字节数组总匹配出特定结尾的区块
|
private static final int MAX_DEPTH
private static final ByteTree.EndMatcher NULL_END_MATCHER
private final byte value
private final int depth
protected String stringValue
private int shift
private T attach
public int getDepth()
public ByteTree<T> search(byte[] bytes, int offset, int len, ByteTree.EndMatcher endMatcher)
public ByteTree<T> search(byte[] bytes, int offset, int limit, ByteTree.EndMatcher endMatcher, boolean cache)
bytes - 待匹配的字节数组offset - 起始位置limit - 截止位置endMatcher - 匹配接口cache - 是否缓存新节点public void addNode(String value)
private ByteTree<T> addNode(byte[] value, int offset, int limit, ByteTree.EndMatcher endMatcher)
private void increase(int size)
public String getStringValue()
public T getAttach()
Copyright © 2023. All rights reserved.