java.lang.Object
swim.codec.Tag
swim.codec.Mark
- All Implemented Interfaces:
Comparable<Mark>,Debug,Display
Description of a source position, identified by byte offset, line, and
column number, with an optional note.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Markat(long offset, int line, int column) Returns a newMarkat the given zero-based byteoffset, one-basedlinenumber, and one-basedcolumnnumber, with no attached note.static MarkReturns a newMarkat the given zero-based byteoffset, one-basedlinenumber, and one-basedcolumnnumber, with the attachednote.intcolumn()Returns the one-based column number of this position.int<T> Output<T>Writes a developer readable, debug-formatted string representation of this object tooutput.<T> Output<T>Writes a human readable, display-formatted string representation of this object tooutput.end()Returns the last source position covered by thisTag.booleaninthashCode()intline()Returns the one-based line number of this position.Returnsthisposition, if its byte offset is greater than or equal tothatposition; otherwise returnsthatposition.Returnsthisposition, if its byte offset is less than or equal tothatposition; otherwise returnsthatposition.note()Returns the note attached to the marked position, ornullif this position has no attached note.longoffset()Returns the zero-based byte offset of this position.Returns the position of thisTagrelative to the givenmark.start()Returns the first source position covered by thisTag.toString()Returns aTagthat includes all source locations covered by both this tag, and someothertag.static Markzero()Returns aMarkat byte offset0, line1, and column1, with no attached note.
-
Method Details
-
offset
public long offset()Returns the zero-based byte offset of this position. -
line
public int line()Returns the one-based line number of this position. -
column
public int column()Returns the one-based column number of this position. -
note
Returns the note attached to the marked position, ornullif this position has no attached note. -
min
Returnsthisposition, if its byte offset is less than or equal tothatposition; otherwise returnsthatposition. -
max
Returnsthisposition, if its byte offset is greater than or equal tothatposition; otherwise returnsthatposition. -
start
Description copied from class:TagReturns the first source position covered by thisTag. -
end
Description copied from class:TagReturns the last source position covered by thisTag. -
union
Description copied from class:TagReturns aTagthat includes all source locations covered by both this tag, and someothertag. -
shift
Description copied from class:TagReturns the position of thisTagrelative to the givenmark. -
compareTo
- Specified by:
compareToin interfaceComparable<Mark>
-
equals
-
hashCode
public int hashCode() -
display
Description copied from interface:DisplayWrites a human readable, display-formatted string representation of this object tooutput. -
debug
Description copied from interface:DebugWrites a developer readable, debug-formatted string representation of this object tooutput. -
toString
-
zero
Returns aMarkat byte offset0, line1, and column1, with no attached note. -
at
Returns a newMarkat the given zero-based byteoffset, one-basedlinenumber, and one-basedcolumnnumber, with the attachednote. -
at
Returns a newMarkat the given zero-based byteoffset, one-basedlinenumber, and one-basedcolumnnumber, with no attached note.
-