Class IntegerRange
- java.lang.Object
-
- org.apache.commons.jexl3.internal.IntegerRange
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Integer>,java.util.Collection<java.lang.Integer>
- Direct Known Subclasses:
IntegerRange.Ascending,IntegerRange.Descending
public abstract class IntegerRange extends java.lang.Object implements java.util.Collection<java.lang.Integer>A range of integers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIntegerRange.AscendingAscending integer range.static classIntegerRange.DescendingDescending integer range.
-
Constructor Summary
Constructors Constructor Description IntegerRange(int from, int to)Creates a new range.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanadd(java.lang.Integer e)booleanaddAll(java.util.Collection<? extends java.lang.Integer> c)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)static IntegerRangecreate(int from, int to)Creates a range, ascending or descending depending on boundaries order.booleanequals(java.lang.Object obj)intgetMax()Gets the interval maximum value.intgetMin()Gets the interval minimum value.inthashCode()booleanisEmpty()abstract java.util.Iterator<java.lang.Integer>iterator()booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)intsize()java.lang.Object[]toArray()<T> T[]toArray(T[] array)
-
-
-
Method Detail
-
create
public static IntegerRange create(int from, int to)
Creates a range, ascending or descending depending on boundaries order.- Parameters:
from- the lower inclusive boundaryto- the higher inclusive boundary- Returns:
- a range
-
add
public boolean add(java.lang.Integer e)
- Specified by:
addin interfacejava.util.Collection<java.lang.Integer>
-
addAll
public boolean addAll(java.util.Collection<? extends java.lang.Integer> c)
- Specified by:
addAllin interfacejava.util.Collection<java.lang.Integer>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<java.lang.Integer>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
containsin interfacejava.util.Collection<java.lang.Integer>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAllin interfacejava.util.Collection<java.lang.Integer>
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfacejava.util.Collection<java.lang.Integer>- Overrides:
equalsin classjava.lang.Object
-
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 interfacejava.util.Collection<java.lang.Integer>- Overrides:
hashCodein classjava.lang.Object
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection<java.lang.Integer>
-
iterator
public abstract java.util.Iterator<java.lang.Integer> iterator()
- Specified by:
iteratorin interfacejava.util.Collection<java.lang.Integer>- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Integer>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
removein interfacejava.util.Collection<java.lang.Integer>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAllin interfacejava.util.Collection<java.lang.Integer>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAllin interfacejava.util.Collection<java.lang.Integer>
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection<java.lang.Integer>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection<java.lang.Integer>
-
toArray
public <T> T[] toArray(T[] array)
- Specified by:
toArrayin interfacejava.util.Collection<java.lang.Integer>
-
-