Module swim.codec
Package swim.codec

Class Span

  • All Implemented Interfaces:
    Debug, Display

    public final class Span
    extends Tag
    Description of a source range, identified by a closed interval between start and end marks.
    • Method Detail

      • start

        public Mark start()
        Description copied from class: Tag
        Returns the first source position covered by this Tag.
        Specified by:
        start in class Tag
      • end

        public Mark end()
        Description copied from class: Tag
        Returns the last source position covered by this Tag.
        Specified by:
        end in class Tag
      • union

        public Tag union​(Tag other)
        Description copied from class: Tag
        Returns a Tag that includes all source locations covered by both this tag, and some other tag.
        Specified by:
        union in class Tag
      • shift

        public Span shift​(Mark mark)
        Description copied from class: Tag
        Returns the position of this Tag relative to the given mark.
        Specified by:
        shift in class Tag
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • display

        public <T> Output<T> display​(Output<T> output)
        Description copied from interface: Display
        Writes a human readable, display-formatted string representation of this object to output.
        Returns:
        the continuation of the output.
      • debug

        public <T> Output<T> debug​(Output<T> output)
        Description copied from interface: Debug
        Writes a developer readable, debug-formatted string representation of this object to output.
        Returns:
        the continuation of the output.
      • from

        public static Span from​(Mark start,
                                Mark end)
        Returns a new Span representing the closed interval between the given start and end marks.