public class CharSequenceWrapper extends Object implements CharSequence
DrillBuf to the CharSequence. The implementation is meant to be
re-used that is allocated once and then passed DrillBuf to adapt. This can be
handy to exploit API that consume CharSequence avoiding the need to create
string objects.| Constructor and Description |
|---|
CharSequenceWrapper() |
CharSequenceWrapper(int start,
int end,
DrillBuf buffer) |
| Modifier and Type | Method and Description |
|---|---|
char |
charAt(int index) |
int |
length() |
void |
setBuffer(int start,
int end,
DrillBuf buffer)
Set the DrillBuf to adapt to a CharSequence.
|
CharSequence |
subSequence(int start,
int end)
When using the Java regex
Matcher the subSequence is only called
when capturing groups. |
String |
toString()
The regexp_replace function is implemented in a way to avoid the call to toString()
not to uselessly create a string object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitchars, codePointspublic CharSequenceWrapper()
public CharSequenceWrapper(int start,
int end,
DrillBuf buffer)
public int length()
length in interface CharSequencepublic char charAt(int index)
charAt in interface CharSequencepublic CharSequence subSequence(int start, int end)
Matcher the subSequence is only called
when capturing groups. Drill does not currently use capture groups in the
UDF so this method is not required.subSequence in interface CharSequencepublic void setBuffer(int start,
int end,
DrillBuf buffer)
start - end - buffer - public String toString()
toString in interface CharSequencetoString in class ObjectCopyright © 2022 The Apache Software Foundation. All rights reserved.