class StringWithPosition
extends java.lang.Object
| Constructor and Description |
|---|
StringWithPosition(java.lang.String string)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
char |
at()
Returns the character at the actual position.
|
char |
at(int inc)
Returns the character at the actual position including the increment
inc. |
void |
consumeLine()
Consumes the line including the line end starting at the current position.
|
void |
consumeLineEnd()
Consumes the line end starting at the current position.
|
void |
consumeLineUntilEnd()
Consumes the line until the line end starting at the current position.
|
void |
inc()
Increments the actual position by 1.
|
void |
inc(int inc)
Increments the actual position by
inc. |
boolean |
inRange()
Returns whether the actual position is in range.
|
boolean |
inRange(int inc)
Returns whether the actual position including the increment
inc is in range. |
private boolean |
isLineEnd()
Returns whether the actual character is a line end character.
|
int |
pos()
Returns the actual position.
|
public StringWithPosition(java.lang.String string)
string - the string to be storedpublic int pos()
public char at()
java.lang.IndexOutOfBoundsException - in case that the position is invalidpublic boolean inRange()
true if the actual position is in range, false elsepublic void inc()
public void inc(int inc)
inc.inc - the incrementpublic boolean inRange(int inc)
inc is in range.inc - the incrementtrue if the specified position is in range, false elsepublic char at(int inc)
inc.inc - the incrementjava.lang.IndexOutOfBoundsException - in case that the specified position is invalidpublic void consumeLineEnd()
public void consumeLineUntilEnd()
public void consumeLine()
private boolean isLineEnd()
true if it is a line end character, false elseCopyright © 2009 - 2018 SSE. All Rights Reserved.