Class LinkSpanImpl

java.lang.Object
org.nibor.autolink.internal.LinkSpanImpl
All Implemented Interfaces:
LinkSpan, Span

public class LinkSpanImpl extends Object implements LinkSpan
  • Field Details

    • linkType

      private final LinkType linkType
    • beginIndex

      private final int beginIndex
    • endIndex

      private final int endIndex
  • Constructor Details

    • LinkSpanImpl

      public LinkSpanImpl(LinkType linkType, int beginIndex, int endIndex)
  • Method Details

    • getType

      public LinkType getType()
      Specified by:
      getType in interface LinkSpan
      Returns:
      the type of link
    • getBeginIndex

      public int getBeginIndex()
      Specified by:
      getBeginIndex in interface Span
      Returns:
      begin index (inclusive) in the original input that this link starts at
    • getEndIndex

      public int getEndIndex()
      Specified by:
      getEndIndex in interface Span
      Returns:
      end index (exclusive) in the original input that this link ends at; in other words, index of first character after link
    • toString

      public String toString()
      Overrides:
      toString in class Object