程序包 org.antlr.misc
类 Interval
- java.lang.Object
-
- org.antlr.misc.Interval
-
public class Interval extends java.lang.Object
An immutable inclusive interval a..b
-
-
字段概要
字段 修饰符和类型 字段 说明 int
a
int
b
static int
creates
static int
hits
static int
INTERVAL_POOL_MAX_VALUE
static int
misses
static int
outOfRange
-
构造器概要
构造器 构造器 说明 Interval(int a, int b)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
adjacent(Interval other)
Are two intervals adjacent such as 0..41 and 42..42?static Interval
create(int a, int b)
Interval objects are used readonly so share all with the same single value a==b up to some max size.Interval
differenceNotProperlyContained(Interval other)
Return the interval with elements from this not in other; other must not be totally enclosed (properly contained) within this, which would result in two disjoint intervals instead of the single one returned by this method.boolean
disjoint(Interval other)
Are both ranges disjoint? I.e., no overlap?boolean
equals(java.lang.Object o)
Interval
intersection(Interval other)
Return the interval in common between this and oboolean
properlyContains(Interval other)
boolean
startsAfter(Interval other)
Does this.a start after other.b? May or may not be disjointboolean
startsAfterDisjoint(Interval other)
Does this start completely after other? Disjointboolean
startsAfterNonDisjoint(Interval other)
Does this start after other? NonDisjointboolean
startsBeforeDisjoint(Interval other)
Does this start completely before other? Disjointboolean
startsBeforeNonDisjoint(Interval other)
Does this start at or before other? Nondisjointjava.lang.String
toString()
Interval
union(Interval other)
Return the interval computed from combining this and other
-
-
-
字段详细资料
-
INTERVAL_POOL_MAX_VALUE
public static final int INTERVAL_POOL_MAX_VALUE
- 另请参阅:
- 常量字段值
-
a
public int a
-
b
public int b
-
creates
public static int creates
-
misses
public static int misses
-
hits
public static int hits
-
outOfRange
public static int outOfRange
-
-
方法详细资料
-
create
public static Interval create(int a, int b)
Interval objects are used readonly so share all with the same single value a==b up to some max size. Use an array as a perfect hash. Return shared object for 0..INTERVAL_POOL_MAX_VALUE or a new Interval object with a..a in it. On Java.g, 218623 IntervalSets have a..a (set with 1 element).
-
equals
public boolean equals(java.lang.Object o)
- 覆盖:
equals
在类中java.lang.Object
-
startsBeforeDisjoint
public boolean startsBeforeDisjoint(Interval other)
Does this start completely before other? Disjoint
-
startsBeforeNonDisjoint
public boolean startsBeforeNonDisjoint(Interval other)
Does this start at or before other? Nondisjoint
-
startsAfter
public boolean startsAfter(Interval other)
Does this.a start after other.b? May or may not be disjoint
-
startsAfterDisjoint
public boolean startsAfterDisjoint(Interval other)
Does this start completely after other? Disjoint
-
startsAfterNonDisjoint
public boolean startsAfterNonDisjoint(Interval other)
Does this start after other? NonDisjoint
-
disjoint
public boolean disjoint(Interval other)
Are both ranges disjoint? I.e., no overlap?
-
adjacent
public boolean adjacent(Interval other)
Are two intervals adjacent such as 0..41 and 42..42?
-
properlyContains
public boolean properlyContains(Interval other)
-
union
public Interval union(Interval other)
Return the interval computed from combining this and other
-
intersection
public Interval intersection(Interval other)
Return the interval in common between this and o
-
differenceNotProperlyContained
public Interval differenceNotProperlyContained(Interval other)
Return the interval with elements from this not in other; other must not be totally enclosed (properly contained) within this, which would result in two disjoint intervals instead of the single one returned by this method.
-
toString
public java.lang.String toString()
- 覆盖:
toString
在类中java.lang.Object
-
-