public class Interval extends Object implements Intervalable
| 构造器和说明 |
|---|
Interval(int start,
int end)
Constructs an interval with a start and end position.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(Object o) |
boolean |
equals(Object o) |
int |
getEnd()
Returns the ending offset into the text for this interval.
|
int |
getStart()
Returns the starting offset into the text for this interval.
|
int |
hashCode() |
boolean |
overlapsWith(int point) |
boolean |
overlapsWith(Interval other)
Answers whether the given interval overlaps this interval
instance.
|
int |
size()
Returns the length of the interval.
|
String |
toString()
Returns the starting offset and ending offset separated
by a full colon (:).
|
public Interval(int start,
int end)
start - The interval's starting text position.end - The interval's ending text position.public int getStart()
getStart 在接口中 Intervalablepublic int getEnd()
getEnd 在接口中 Intervalablepublic int size()
size 在接口中 Intervalablepublic boolean overlapsWith(Interval other)
other - public boolean overlapsWith(int point)
public int compareTo(Object o)
compareTo 在接口中 ComparableCopyright © 2019. All rights reserved.