.. java:import:: java.io FileInputStream .. java:import:: java.io IOException .. java:import:: java.io InputStream .. java:import:: java.util ArrayList .. java:import:: java.util Collections .. java:import:: java.util List .. java:import:: java.util Scanner Source ====== .. java:package:: com.ampl :noindex: .. java:type:: final class Source An input source such as a file or a text buffer. The source may optionally contain information about start offsets of each line in which case it can entity offsets to line and column numbers. For this to work \ ``endLine``\ should be called for each line in the order as they appear in the input. Methods ------- endLine ^^^^^^^ .. java:method:: public void endLine(int length) :outertype: Source Notifies the source of the line end. getColumnNumber ^^^^^^^^^^^^^^^ .. java:method:: public int getColumnNumber(int offset, int lineNumber) :outertype: Source Returns the column number for the specified offset in the input. getLineNumber ^^^^^^^^^^^^^ .. java:method:: public int getLineNumber(int offset) :outertype: Source Returns the line number for the specified offset in the input. getName ^^^^^^^ .. java:method:: public String getName() :outertype: Source Returns the name of this source. getText ^^^^^^^ .. java:method:: public String getText() :outertype: Source newFileSource ^^^^^^^^^^^^^ .. java:method:: public static Source newFileSource(String filename) throws IOException :outertype: Source Constructs a new source from a file. newStringSource ^^^^^^^^^^^^^^^ .. java:method:: public static Source newStringSource(String name, String input) :outertype: Source Constructs a new source from a string containing the input. newStringSource ^^^^^^^^^^^^^^^ .. java:method:: public static Source newStringSource(String input) :outertype: Source Constructs a new source from a string containing the input.