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 classAscending integer range.static classDescending integer range. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends Integer> c) voidclear()booleanbooleancontainsAll(Collection<?> c) static IntegerRangecreate(int from, int to) Creates a range, ascending or descending depending on boundaries order.booleanintgetMax()Gets the interval maximum value.intgetMin()Gets the interval minimum value.inthashCode()booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Object[]toArray()<T> T[]toArray(T[] array) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream
-
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
-
add
- Specified by:
addin interfaceCollection<Integer>
-
addAll
- Specified by:
addAllin interfaceCollection<Integer>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Integer>
-
contains
- Specified by:
containsin interfaceCollection<Integer>
-
containsAll
- Specified by:
containsAllin interfaceCollection<Integer>
-
equals
- Specified by:
equalsin interfaceCollection<Integer>- Overrides:
equalsin classObject
-
getMax
public int getMax()Gets the interval maximum value.- Returns:
- the high boundary
-
getMin
public int getMin()Gets the interval minimum value.- Returns:
- the low boundary
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Integer>- Overrides:
hashCodein classObject
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<Integer>
-
iterator
-
remove
- Specified by:
removein interfaceCollection<Integer>
-
removeAll
- Specified by:
removeAllin interfaceCollection<Integer>
-
retainAll
- Specified by:
retainAllin interfaceCollection<Integer>
-
size
public int size()- Specified by:
sizein interfaceCollection<Integer>
-
toArray
- Specified by:
toArrayin interfaceCollection<Integer>
-
toArray
public <T> T[] toArray(T[] array) - Specified by:
toArrayin interfaceCollection<Integer>
-