Package jjparse.input
Class CharacterInput
- All Implemented Interfaces:
CharSequence
A specific implementation of an
Input for Characters that also implements the CharSequence
interface. Input<Character>.Positions returned by this Input are aware of unicode code points such that calling
Input.Position.toString() shows the line and column numbers as they are perceived by the user. Instances of this
class can be obtained using one of the variants of Input.of(java.lang.String, java.util.Iterator<T>).- Author:
- Björn Lötters
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classRepresents aInput<Character>.Positionin thisCharacterInputthat is aware of the underlying unicode code points.Nested classes/interfaces inherited from class jjparse.input.Input
Input.Position -
Field Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints
-
Method Details
-
isEmpty
public boolean isEmpty()Description copied from class:InputChecks whether thisInputis empty. -
head
Description copied from class:Input -
tail
Description copied from class:Input -
position
Description copied from class:Input -
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
toString
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-