Package net.fauxpark.stringes
Class Chare
- java.lang.Object
-
- net.fauxpark.stringes.Chare
-
public final class Chare extends Object
Represents a Chare, which provides location information on a character taken from a Stringe.
-
-
Method Summary
Modifier and Type Method Description chargetCharacter()Returns the Chare's underlying character.intgetColumn()Returns the 1-based column number of the Chare.intgetLine()Returns the 1-based line number of the Chare.intgetOffset()Returns the Chare's offset.StringegetSource()Returns the Chare's source Stringe.StringtoString()Returns the string representation of the current Chare.
-
-
-
Constructor Detail
-
Chare
Chare(Stringe source, char c, int offset)
Constructs a new Chare with offset information.- Parameters:
source- The source Stringe this Chare was taken from.c- The char value of the Chare.offset- The offset of the Chare relative to the Stringe.
-
Chare
Chare(Stringe source, char c, int offset, int line, int column)
Constructs a new Chare with offset, line and column information.- Parameters:
source- The source Stringe this Chare was taken from.c- The char value of the Chare.offset- The offset of the Chare relative to the Stringe.line- The 1-based line number in the Stringe.column- The 1-based column number in the Stringe.
-
-
Method Detail
-
getSource
public Stringe getSource()
Returns the Chare's source Stringe.- Returns:
- The Stringe this Chare is part of.
-
getCharacter
public char getCharacter()
Returns the Chare's underlying character.- Returns:
- The char value this Chare represents.
-
getOffset
public int getOffset()
Returns the Chare's offset.- Returns:
- The offset of the Chare relative to its source Stringe.
-
getLine
public int getLine()
Returns the 1-based line number of the Chare.- Returns:
- The line number this Chare is on.
-
getColumn
public int getColumn()
Returns the 1-based column number of the Chare.- Returns:
- The column number this Chare is on.
-
-