org.apache.commons.jexl3.internal
Class IntegerRange

java.lang.Object
  extended by org.apache.commons.jexl3.internal.IntegerRange
All Implemented Interfaces:
Iterable<Integer>, Collection<Integer>
Direct Known Subclasses:
IntegerRange.Ascending, IntegerRange.Descending

public abstract class IntegerRange
extends Object
implements Collection<Integer>

A range of integers.


Nested Class Summary
static class IntegerRange.Ascending
          Ascending integer range.
static class IntegerRange.Descending
          Descending integer range.
 
Field Summary
protected  int max
          The upper boundary.
protected  int min
          The lower boundary.
 
Constructor Summary
IntegerRange(int from, int to)
          Creates a new range.
 
Method Summary
 boolean add(Integer e)
           
 boolean addAll(Collection<? extends Integer> c)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
static IntegerRange create(int from, int to)
          Creates a range, ascending or descending depending on boundaries order.
 boolean equals(Object obj)
           
 int getMax()
          Gets the interval maximum value.
 int getMin()
          Gets the interval minimum value.
 int hashCode()
           
 boolean isEmpty()
           
abstract  Iterator<Integer> iterator()
           
 boolean remove(Object o)
           
 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
 

Field Detail

min

protected final int min
The lower boundary.


max

protected final int max
The upper boundary.

Constructor Detail

IntegerRange

public IntegerRange(int from,
                    int to)
Creates a new range.

Parameters:
from - the lower inclusive boundary
to - the higher inclusive boundary
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 boundary
to - 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 interface Collection<Integer>
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Specified by:
equals in interface Collection<Integer>
Overrides:
equals in class Object

iterator

public abstract Iterator<Integer> iterator()
Specified by:
iterator in interface Iterable<Integer>
Specified by:
iterator in interface Collection<Integer>

size

public int size()
Specified by:
size in interface Collection<Integer>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<Integer>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<Integer>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<Integer>

toArray

public <T> T[] toArray(T[] array)
Specified by:
toArray in interface Collection<Integer>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<Integer>

add

public boolean add(Integer e)
Specified by:
add in interface Collection<Integer>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<Integer>

addAll

public boolean addAll(Collection<? extends Integer> c)
Specified by:
addAll in interface Collection<Integer>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<Integer>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<Integer>

clear

public void clear()
Specified by:
clear in interface Collection<Integer>


Copyright © 2001–2017 The Apache Software Foundation. All rights reserved.