|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.fastutil.ints.AbstractIntCollection
it.unimi.dsi.fastutil.ints.AbstractIntSet
it.unimi.dsi.fastutil.ints.AbstractIntSortedSet
it.unimi.dsi.mg4j.search.Interval
dsiutils
.
@Deprecated public final class Interval
An integral interval. An interval is defined
by two integers, called its left
and right
extremes, and contains all integers x such that
left
≤ x ≤ right
.
This class has no constructor: use the static factory methods
valueOf(int, int)
and valueOf(int)
, instead.
Instances of this class are immutable, and moreover implement
the IntSortedSet
interface. The
equality method allows to check equality with
both sorted and non-sorted sets of integers.
To reduce garbage collection, intervals made of one non-negative small points are precomputed and returned upon request.
Field Summary | |
---|---|
int |
left
Deprecated. The left extreme of the interval. |
int |
right
Deprecated. The right extreme of the interval. |
Constructor Summary | |
---|---|
protected |
Interval(int left,
int right)
Deprecated. Builds an interval with given extremes. |
Method Summary | |
---|---|
IntComparator |
comparator()
Deprecated. |
int |
compareTo(int x)
Deprecated. Compares this interval to an integer. |
int |
compareTo(int x,
int radius)
Deprecated. Compares this interval to an integer with a specified radius. |
int |
compareTo(int x,
int leftRadius,
int rightRadius)
Deprecated. Compares this interval to an integer with specified left and right radii. |
boolean |
contains(int x)
Deprecated. Checks whether this interval contains the specified integer. |
boolean |
contains(Interval interval)
Deprecated. Checks whether this interval contains the specified interval. |
boolean |
contains(int x,
int radius)
Deprecated. Checks whether this interval would contain the specified integer if enlarged in both directions by the specified radius. |
boolean |
contains(int x,
int leftRadius,
int rightRadius)
Deprecated. Checks whether this interval would contain the specified integer if enlarged in each direction with the respective radius. |
boolean |
equals(Object o)
Deprecated. Checks whether this interval is equal to another set of integers. |
int |
firstInt()
Deprecated. |
int |
hashCode()
Deprecated. |
IntSortedSet |
headSet(int to)
Deprecated. |
IntBidirectionalIterator |
iterator()
Deprecated. Returns an iterator over the integers in this interval. |
IntBidirectionalIterator |
iterator(int from)
Deprecated. Returns an iterator over the integers in this interval larger than or equal to a given integer. |
int |
lastInt()
Deprecated. |
int |
length()
Deprecated. Returns the interval length, that is, the number of integers contained in the interval. |
int |
size()
Deprecated. An alias for length() . |
IntSortedSet |
subSet(int from,
int to)
Deprecated. |
IntSortedSet |
tailSet(int from)
Deprecated. |
String |
toString()
Deprecated. |
static Interval |
valueOf(int point)
Deprecated. Returns a one-point interval. |
static Interval |
valueOf(int left,
int right)
Deprecated. Returns an interval with given extremes. |
Methods inherited from class it.unimi.dsi.fastutil.ints.AbstractIntSortedSet |
---|
first, headSet, intIterator, last, subSet, tailSet |
Methods inherited from class it.unimi.dsi.fastutil.ints.AbstractIntSet |
---|
rem, remove, remove |
Methods inherited from class it.unimi.dsi.fastutil.ints.AbstractIntCollection |
---|
add, add, addAll, addAll, clear, contains, containsAll, containsAll, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toIntArray, toIntArray |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface it.unimi.dsi.fastutil.ints.IntSortedSet |
---|
headSet, intIterator, subSet, tailSet |
Methods inherited from interface it.unimi.dsi.fastutil.ints.IntSet |
---|
remove |
Methods inherited from interface it.unimi.dsi.fastutil.ints.IntCollection |
---|
add, addAll, containsAll, rem, removeAll, retainAll, toArray, toArray, toIntArray, toIntArray |
Methods inherited from interface java.util.Set |
---|
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Methods inherited from interface java.util.SortedSet |
---|
first, last |
Methods inherited from interface java.util.Set |
---|
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Field Detail |
---|
public final int left
public final int right
Constructor Detail |
---|
protected Interval(int left, int right)
You cannot generate an empty interval with this constructor. Use Intervals.EMPTY_INTERVAL
instead.
left
- the left extreme.right
- the right extreme (which must be greater than
or equal to the left extreme).Method Detail |
---|
public static Interval valueOf(int left, int right)
You cannot obtain an empty interval with this factory method. Use Intervals.EMPTY_INTERVAL
instead.
left
- the left extreme.right
- the right extreme (which must be greater than
or equal to the left extreme).
public static Interval valueOf(int point)
You cannot obtain an empty interval with this factory method. Use Intervals.EMPTY_INTERVAL
instead.
point
- a point.
public int length()
public int size()
length()
.
size
in interface Collection<Integer>
size
in interface Set<Integer>
public IntBidirectionalIterator iterator()
iterator
in interface IntCollection
iterator
in interface IntIterable
iterator
in interface IntSet
iterator
in interface IntSortedSet
iterator
in interface Iterable<Integer>
iterator
in interface Collection<Integer>
iterator
in interface Set<Integer>
iterator
in class AbstractIntSortedSet
public IntBidirectionalIterator iterator(int from)
iterator
in interface IntSortedSet
from
- the starting integer.
public boolean contains(int x)
contains
in interface IntCollection
x
- an integer.
x
, that is,
whether left
≤ x
≤ right
.public boolean contains(Interval interval)
interval
- an interval.
interval
.public boolean contains(int x, int radius)
x
- an integer.radius
- the radius.
radius
would contain x
,
e.g., whether left
−radius
≤ x
≤ right
+radius
.public boolean contains(int x, int leftRadius, int rightRadius)
x
- an integer.leftRadius
- the left radius.rightRadius
- the right radius.
leftRadius
and to the right by rightRadius
would contain x
,
e.g., whether left
−leftRadius
≤ x
≤ right
+rightRadius
.public int compareTo(int x)
x
- an integer.
x
is positioned
at the left, belongs, or is positioned to the right of this interval, e.g.,
as x
< left
,
left
≤ x
≤ right
or
right
< x
.public int compareTo(int x, int radius)
x
- an integer.radius
- the radius.
x
is positioned
at the left, belongs, or is positioned to the right of this interval enlarged by radius
, that is,
as x
< left
−radius
,
left
−radius
≤ x
≤ right
+radius
or
right
+radius
< x
.public int compareTo(int x, int leftRadius, int rightRadius)
x
- an integer.leftRadius
- the left radius.rightRadius
- the right radius.
x
is positioned
at the left, belongs, or is positioned to the right of this interval enlarged by leftRadius
on the left and rightRadius
in the right, that is,
as x
< left
−leftRadius
,
left
−leftRadius
≤ x
≤ right
+rightRadius
or
right
+rightRadius
< x
.public IntComparator comparator()
comparator
in interface IntSortedSet
comparator
in interface SortedSet<Integer>
public IntSortedSet headSet(int to)
headSet
in interface IntSortedSet
public IntSortedSet tailSet(int from)
tailSet
in interface IntSortedSet
public IntSortedSet subSet(int from, int to)
subSet
in interface IntSortedSet
public int firstInt()
firstInt
in interface IntSortedSet
public int lastInt()
lastInt
in interface IntSortedSet
public String toString()
toString
in class AbstractIntCollection
public int hashCode()
hashCode
in interface Collection<Integer>
hashCode
in interface Set<Integer>
hashCode
in class AbstractIntSet
public boolean equals(Object o)
equals
in interface Collection<Integer>
equals
in interface Set<Integer>
equals
in class AbstractIntSet
o
- an object.
o
is an ordered set of integer containing
the same element of this interval in the same order, or if o
is a set of integers containing the same elements of this interval.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |