public class Interval extends Object implements Intervalable
| 构造器和说明 |
|---|
Interval(int start,
int end)
构造一个区间
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(Object o) |
boolean |
equals(Object o) |
int |
getEnd()
终点
|
int |
getStart()
起点
|
int |
hashCode() |
boolean |
overlapsWith(int point)
区间是否覆盖了这个点
|
boolean |
overlapsWith(Interval other)
是否与另一个区间交叉(有一部分重叠)
|
int |
size()
长度
|
String |
toString() |
public int getStart()
IntervalablegetStart 在接口中 Intervalablepublic int getEnd()
IntervalablegetEnd 在接口中 Intervalablepublic int size()
Intervalablesize 在接口中 Intervalablepublic boolean overlapsWith(Interval other)
other - public boolean overlapsWith(int point)
point - public int compareTo(Object o)
compareTo 在接口中 ComparableCopyright © 2014–2017 码农场. All rights reserved.