Class Position

java.lang.Object
org.scijava.parsington.Position

public class Position extends Object
A mutable parse position. Similar to ParsePosition, but less complex.
Author:
Curtis Rueden
  • 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

      public char ch(CharSequence s)
    • ch

      public char ch(CharSequence s, int offset)
    • die

      public void die(String message)
      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

      public void assertThat(boolean condition, String message)
      Calls fail(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

      public void fail(String message)
      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

      public String toString()
      Overrides:
      toString in class Object