Package org.scijava.parsington
Class Position
java.lang.Object
org.scijava.parsington.Position
A mutable parse position. Similar to
ParsePosition
, but
less complex.- Author:
- Curtis Rueden
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
assertThat
(boolean condition, String message) Callsfail(String)
if a condition is not met.char
ch
(CharSequence s) char
ch
(CharSequence s, int offset) void
Throws an exception with an informative message.void
Throws an exception.int
get()
void
inc()
void
inc
(int count) void
set
(int index) toString()
-
Constructor Details
-
Position
public Position()
-
-
Method Details
-
get
public int get() -
set
public void set(int index) -
inc
public void inc() -
inc
public void inc(int count) -
ch
-
ch
-
die
Throws an exception with an informative message. Called by the parsing infrastructure when syntax is incorrect.- Parameters:
message
- The text to use as a basis for the error message.- Throws:
IllegalArgumentException
- Always.
-
assertThat
Callsfail(String)
if a condition is not met. Called by the parsing infrastructure to assert that things are going OK.- Parameters:
condition
- If false, throw the exception.message
- The text to use as a basis for the error message.- Throws:
IllegalStateException
- If the condition is not met.
-
fail
Throws an exception. Called by the parsing infrastructure when something goes wrong.- Parameters:
message
- The text to use as a basis for the error message.- Throws:
IllegalStateException
- Always.
-
toString
-