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 class
Ascending long range.static class
Descending long range. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends Long> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) static LongRange
create
(long from, long to) Creates a range, ascending or descending depending on boundaries order.boolean
long
getMax()
Gets the interval maximum value.long
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 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
-
getMin
public long getMin()Gets the interval minimum value.- Returns:
- the low boundary
-
getMax
public long getMax()Gets the interval maximum value.- Returns:
- the high boundary
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<Long>
- Overrides:
hashCode
in classObject
-
equals
- Specified by:
equals
in interfaceCollection<Long>
- Overrides:
equals
in classObject
-
iterator
-
size
public int size()- Specified by:
size
in interfaceCollection<Long>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<Long>
-
contains
- Specified by:
contains
in interfaceCollection<Long>
-
toArray
- Specified by:
toArray
in interfaceCollection<Long>
-
toArray
public <T> T[] toArray(T[] array) - Specified by:
toArray
in interfaceCollection<Long>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<Long>
-
add
- Specified by:
add
in interfaceCollection<Long>
-
remove
- Specified by:
remove
in interfaceCollection<Long>
-
addAll
- Specified by:
addAll
in interfaceCollection<Long>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<Long>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<Long>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<Long>
-