public abstract class LongRange extends Object implements Collection<Long>
Behaves as a readonly collection of longs.
| Modifier and Type | Class and Description |
|---|---|
static class |
LongRange.Ascending
Ascending long range.
|
static class |
LongRange.Descending
Descending long range.
|
| Modifier and Type | Field and Description |
|---|---|
protected long |
max
The upper boundary.
|
protected long |
min
The lower boundary.
|
| Modifier | Constructor and Description |
|---|---|
protected |
LongRange(long from,
long to)
Creates a new range.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Long e) |
boolean |
addAll(Collection<? extends Long> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
static LongRange |
create(long from,
long to)
Creates a range, ascending or descending depending on boundaries order.
|
boolean |
equals(Object obj) |
long |
getMax()
Gets the interval maximum value.
|
long |
getMin()
Gets the interval minimum value.
|
int |
hashCode() |
boolean |
isEmpty() |
abstract Iterator<Long> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
protected final long min
protected final long max
protected LongRange(long from,
long to)
from - the lower inclusive boundaryto - the higher inclusive boundarypublic static LongRange create(long from, long to)
from - the lower inclusive boundaryto - the higher inclusive boundarypublic long getMin()
public long getMax()
public int hashCode()
hashCode in interface Collection<Long>hashCode in class Objectpublic boolean equals(Object obj)
equals in interface Collection<Long>equals in class Objectpublic int size()
size in interface Collection<Long>public boolean isEmpty()
isEmpty in interface Collection<Long>public boolean contains(Object o)
contains in interface Collection<Long>public Object[] toArray()
toArray in interface Collection<Long>public <T> T[] toArray(T[] array)
toArray in interface Collection<Long>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<Long>public boolean add(Long e)
add in interface Collection<Long>public boolean remove(Object o)
remove in interface Collection<Long>public boolean addAll(Collection<? extends Long> c)
addAll in interface Collection<Long>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<Long>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<Long>public void clear()
clear in interface Collection<Long>Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.