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 Mark
at
(long offset, int line, int column) Returns a newMark
at the given zero-based byteoffset
, one-basedline
number, and one-basedcolumn
number, with no attached note.static Mark
Returns a newMark
at the given zero-based byteoffset
, one-basedline
number, and one-basedcolumn
number, with the attachednote
.int
column()
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
.boolean
int
hashCode()
int
line()
Returns the one-based line number of this position.Returnsthis
position, if its byte offset is greater than or equal tothat
position; otherwise returnsthat
position.Returnsthis
position, if its byte offset is less than or equal tothat
position; otherwise returnsthat
position.note()
Returns the note attached to the marked position, ornull
if this position has no attached note.long
offset()
Returns the zero-based byte offset of this position.Returns the position of thisTag
relative to the givenmark
.start()
Returns the first source position covered by thisTag
.toString()
Returns aTag
that includes all source locations covered by both this tag, and someother
tag.static Mark
zero()
Returns aMark
at 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, ornull
if this position has no attached note. -
min
Returnsthis
position, if its byte offset is less than or equal tothat
position; otherwise returnsthat
position. -
max
Returnsthis
position, if its byte offset is greater than or equal tothat
position; otherwise returnsthat
position. -
start
Description copied from class:Tag
Returns the first source position covered by thisTag
. -
end
Description copied from class:Tag
Returns the last source position covered by thisTag
. -
union
Description copied from class:Tag
Returns aTag
that includes all source locations covered by both this tag, and someother
tag. -
shift
Description copied from class:Tag
Returns the position of thisTag
relative to the givenmark
. -
compareTo
- Specified by:
compareTo
in interfaceComparable<Mark>
-
equals
-
hashCode
public int hashCode() -
display
Description copied from interface:Display
Writes a human readable, display-formatted string representation of this object tooutput
. -
debug
Description copied from interface:Debug
Writes a developer readable, debug-formatted string representation of this object tooutput
. -
toString
-
zero
Returns aMark
at byte offset0
, line1
, and column1
, with no attached note. -
at
Returns a newMark
at the given zero-based byteoffset
, one-basedline
number, and one-basedcolumn
number, with the attachednote
. -
at
Returns a newMark
at the given zero-based byteoffset
, one-basedline
number, and one-basedcolumn
number, with no attached note.
-