Class LongRange
java.lang.Object
org.apache.commons.jexl3.internal.LongRange
- All Implemented Interfaces:
Iterable<Long>,Collection<Long>
- Direct Known Subclasses:
LongRange.Ascending,LongRange.Descending
A range of longs.
Behaves as a readonly collection of longs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAscending long range.static classDescending long range. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends Long> c) voidclear()booleanbooleancontainsAll(Collection<?> c) static LongRangecreate(long from, long to) Creates a range, ascending or descending depending on boundaries order.booleanlonggetMax()Gets the interval maximum value.longgetMin()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 long minThe lower boundary. -
max
protected final long maxThe upper boundary.
-
-
Constructor Details
-
LongRange
protected LongRange(long from, long 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<Long>
-
addAll
- Specified by:
addAllin interfaceCollection<Long>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Long>
-
contains
- Specified by:
containsin interfaceCollection<Long>
-
containsAll
- Specified by:
containsAllin interfaceCollection<Long>
-
equals
- Specified by:
equalsin interfaceCollection<Long>- Overrides:
equalsin classObject
-
getMax
public long getMax()Gets the interval maximum value.- Returns:
- the high boundary
-
getMin
public long getMin()Gets the interval minimum value.- Returns:
- the low boundary
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Long>- Overrides:
hashCodein classObject
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<Long>
-
iterator
-
remove
- Specified by:
removein interfaceCollection<Long>
-
removeAll
- Specified by:
removeAllin interfaceCollection<Long>
-
retainAll
- Specified by:
retainAllin interfaceCollection<Long>
-
size
public int size()- Specified by:
sizein interfaceCollection<Long>
-
toArray
- Specified by:
toArrayin interfaceCollection<Long>
-
toArray
public <T> T[] toArray(T[] array) - Specified by:
toArrayin interfaceCollection<Long>
-