Class OffsetRange
- java.lang.Object
-
- org.apache.lucene.search.matchhighlight.OffsetRange
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
MatchHighlighter.QueryOffsetRange
,Passage
public class OffsetRange extends Object implements Cloneable
A non-empty range of offset positions.
-
-
Constructor Summary
Constructors Constructor Description OffsetRange(int from, int to)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OffsetRange
clone()
boolean
contains(OffsetRange other)
boolean
equals(Object other)
int
hashCode()
int
length()
OffsetRange
slice(int from, int to)
Returns a sub-range of this range (a copy).String
toString()
-
-
-
Method Detail
-
length
public int length()
-
slice
public OffsetRange slice(int from, int to)
Returns a sub-range of this range (a copy). Subclasses should override and return an appropriate type covariant so that payloads are not lost.
-
contains
public boolean contains(OffsetRange other)
- Returns:
true
if this range contains or is equal toother
.
-
clone
public OffsetRange clone()
-
-