Package org.scijava.parse
Class SubSequence
java.lang.Object
org.scijava.parse.SubSequence
- All Implemented Interfaces:
CharSequence
A
CharSequence
which is a by-reference subsequence of another
CharSequence
. This is particularly useful for
regex
matching without excessive string
copying.
Surprisingly, core Java does not seem to have this capability (apart from
Segment
, which seems misplaced in the Swing
library); all of String.subSequence(int, int)
, StringBuffer.subSequence(int, int)
and StringBuilder.subSequence(int, int)
internally copy the requested string
segment.
- Author:
- Curtis Rueden
-
Constructor Summary
ConstructorsConstructorDescriptionSubSequence
(CharSequence seq, int offset) SubSequence
(CharSequence seq, int offset, int length) -
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) int
length()
subSequence
(int start, int end) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Constructor Details
-
SubSequence
-
SubSequence
-
-
Method Details
-
length
public int length()- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAt
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
toString
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-