T
- the type of elements held by this range.S
- the type of the step of this range.public interface Range<T extends Comparable<?>,S> extends Iterable<T>
Endpoint
. The left and the right limits can be inclusive
(bounded, closed) or exclusive (unbounded,
open).
The difference between each element within this range is called step. The step can be positive or negative, displaying whether the range elements are ascending or descending.
Endpoint
Modifier and Type | Field and Description |
---|---|
static BoundType |
DEFAULT_LEFT_BOUND_TYPE
Default left bound type.
|
static BoundType |
DEFAULT_RIGHT_BOUND_TYPE
Default right bound type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(T obj)
Returns
true if this range contains the specified element. |
boolean |
containsAll(Collection<T> col)
Returns
true is this range contains all of the elements in
the specified collection. |
Endpoint<T> |
getLeftEndpoint()
Get the left limit of this range.
|
Endpoint<T> |
getRightEndpoint()
Get the right limit of this range.
|
S |
getStep()
Get the step between elements of this range.
|
boolean |
isEmpty()
Returns
true if this range is empty. |
static final BoundType DEFAULT_LEFT_BOUND_TYPE
static final BoundType DEFAULT_RIGHT_BOUND_TYPE
Endpoint<T> getLeftEndpoint()
Endpoint<T> getRightEndpoint()
boolean isEmpty()
true
if this range is empty.true
if this range is emptyboolean contains(T obj)
true
if this range contains the specified element.obj
- element whose presence is being tested in this rangetrue
if this range contains the specified elementboolean containsAll(Collection<T> col)
true
is this range contains all of the elements in
the specified collection.col
- collection to be checked for the containment in this rangetrue
if this range contains all of the elements in
the specified collectionCopyright © 2003–2014 The Apache Software Foundation. All rights reserved.