Class IntegerRange
java.lang.Object
org.apache.commons.jexl3.internal.IntegerRange
- All Implemented Interfaces:
Iterable<Integer>
,Collection<Integer>
- Direct Known Subclasses:
IntegerRange.Ascending
,IntegerRange.Descending
A range of integers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Ascending integer range.static class
Descending integer range. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends Integer> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) static IntegerRange
create
(int from, int to) Creates a range, ascending or descending depending on boundaries order.boolean
int
getMax()
Gets the interval maximum value.int
getMin()
Gets the interval minimum value.int
hashCode()
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] array) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
min
protected final int minThe lower boundary. -
max
protected final int maxThe upper boundary.
-
-
Constructor Details
-
IntegerRange
public IntegerRange(int from, int to) Creates a new range.- Parameters:
from
- the lower inclusive boundaryto
- the higher inclusive boundary
-
-
Method Details
-
create
Creates a range, ascending or descending depending on boundaries order.- Parameters:
from
- the lower inclusive boundaryto
- the higher inclusive boundary- Returns:
- a range
-
getMin
public int getMin()Gets the interval minimum value.- Returns:
- the low boundary
-
getMax
public int getMax()Gets the interval maximum value.- Returns:
- the high boundary
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<Integer>
- Overrides:
hashCode
in classObject
-
equals
- Specified by:
equals
in interfaceCollection<Integer>
- Overrides:
equals
in classObject
-
iterator
-
size
public int size()- Specified by:
size
in interfaceCollection<Integer>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<Integer>
-
contains
- Specified by:
contains
in interfaceCollection<Integer>
-
toArray
- Specified by:
toArray
in interfaceCollection<Integer>
-
toArray
public <T> T[] toArray(T[] array) - Specified by:
toArray
in interfaceCollection<Integer>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<Integer>
-
add
- Specified by:
add
in interfaceCollection<Integer>
-
remove
- Specified by:
remove
in interfaceCollection<Integer>
-
addAll
- Specified by:
addAll
in interfaceCollection<Integer>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<Integer>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<Integer>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<Integer>
-