public abstract class IntegerRange extends Object implements Collection<Integer>
Modifier and Type | Class and Description |
---|---|
static class |
IntegerRange.Ascending
Ascending integer range.
|
static class |
IntegerRange.Descending
Descending integer range.
|
Modifier and Type | Field and Description |
---|---|
protected int |
max
The upper boundary.
|
protected int |
min
The lower boundary.
|
Constructor and Description |
---|
IntegerRange(int from,
int to)
Creates a new range.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Integer e) |
boolean |
addAll(Collection<? extends Integer> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
static IntegerRange |
create(int from,
int to)
Creates a range, ascending or descending depending on boundaries order.
|
boolean |
equals(Object obj) |
int |
getMax()
Gets the interval maximum value.
|
int |
getMin()
Gets the interval minimum value.
|
int |
hashCode() |
boolean |
isEmpty() |
abstract Iterator<Integer> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
protected final int min
protected final int max
public IntegerRange(int from, int to)
from
- the lower inclusive boundaryto
- the higher inclusive boundarypublic static IntegerRange create(int from, int to)
from
- the lower inclusive boundaryto
- the higher inclusive boundarypublic int getMin()
public int getMax()
public int hashCode()
hashCode
in interface Collection<Integer>
hashCode
in class Object
public boolean equals(Object obj)
equals
in interface Collection<Integer>
equals
in class Object
public int size()
size
in interface Collection<Integer>
public boolean isEmpty()
isEmpty
in interface Collection<Integer>
public boolean contains(Object o)
contains
in interface Collection<Integer>
public Object[] toArray()
toArray
in interface Collection<Integer>
public <T> T[] toArray(T[] array)
toArray
in interface Collection<Integer>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<Integer>
public boolean add(Integer e)
add
in interface Collection<Integer>
public boolean remove(Object o)
remove
in interface Collection<Integer>
public boolean addAll(Collection<? extends Integer> c)
addAll
in interface Collection<Integer>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<Integer>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<Integer>
public void clear()
clear
in interface Collection<Integer>
Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.