Package com.amazon.ion
Interface OffsetSpan
-
public interface OffsetSpanExposes the positions of aSpanin the form of zero-based offsets within the source. The "unit of measure" the offsets count depends on the source type: for byte arrays orInputStreams, the offsets count octets, but forStrings orReaders the offsets count UTF-16 code units.WARNING: This interface should not be implemented or extended by code outside of this library.
As with all spans, positions lie between values, and when the start and finish positions are equal, the span is said to be empty.
To get one of these from a
Span, useasFacet(OffsetSpan.class)or one of the helpers fromFacets.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetFinishOffset()Returns this span's finish position as a zero-based offset within the source.longgetStartOffset()Returns this span's start position as a zero-based offset within the source.
-
-
-
Method Detail
-
getStartOffset
long getStartOffset()
Returns this span's start position as a zero-based offset within the source.
-
getFinishOffset
long getFinishOffset()
Returns this span's finish position as a zero-based offset within the source. In some cases, the finish position is implicit and this method returns-1. This includes most text sources, since in general (notably for containers) the finish offset can't be determined without significant effort to parse to the end of the value.
-
-