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 TypeMethodDescriptionvoidassertThat(boolean condition, String message) Callsfail(String)if a condition is not met.charch(CharSequence s) charch(CharSequence s, int offset) voidThrows an exception with an informative message.voidThrows an exception.intget()voidinc()voidinc(int count) voidset(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
-