public class SearchTerm<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
bytes |
private int |
hashCode |
private T |
reference |
| Constructor and Description |
|---|
SearchTerm(byte[] bytes)
Constructs a SearchTerm.
|
SearchTerm(byte[] bytes,
boolean defensiveCopy,
T reference)
Constructs a search term.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
get(int index) |
byte[] |
getBytes() |
T |
getReference() |
int |
hashCode() |
int |
size() |
boolean |
startsWith(byte[] window,
int windowLength)
Determines if the given window starts with the same bytes as this term
|
String |
toString() |
String |
toString(Charset charset) |
private final byte[] bytes
private final int hashCode
private final T reference
public SearchTerm(byte[] bytes)
bytes - the bytes of the search termIllegalArgumentException - if given bytes are null or 0 lengthpublic SearchTerm(byte[] bytes,
boolean defensiveCopy,
T reference)
bytes - the bytes of the new search termdefensiveCopy - if true will make a defensive copy; false otherwisereference - a holder for an object which can be retrieved when this search term hitspublic int get(int index)
public int size()
public T getReference()
public boolean startsWith(byte[] window,
int windowLength)
window - bytes from the haystack being evaluatedwindowLength - The length of the window to considerpublic byte[] getBytes()
Copyright © 2019 Apache NiFi Project. All rights reserved.