public class Range extends ArrayList<Long>
Long values with extra convenience functionality. Values
can be parsed from a properly formatted string.
A head() and tail() convenience method are provided.
Additionally, a hash index is maintained over all values, for faster
contains(Object) performance.
Practically, ranges are ","-separated list of selected values. For each
selection specified, a start value is mandatory. An (inclusive) end value can
be specified using a "-". If an end is specified, a step can also be provided
using a ":". So, 5,6-10:2 would select planes 5, 6, 8 and 10 from the
dimension associated with this Range.
Ranges must match the pattern: \d*(-\d*(:\d*)?)?(,\d*(-\d*(:\d)?*)?)*
Valid patterns:
NB: index order is preserved, so if indices are provided out of order, they will remain out of order.
modCount| Constructor and Description |
|---|
Range(Long index)
Creates a singleton DimRange.
|
Range(long[] values)
Constructs a DimRange that includes only the values contained in the
provided array.
|
Range(Long start,
Long end)
Creates the DimRange: [start, end]
|
Range(String range) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Object l) |
Long |
head() |
Long |
tail() |
add, add, addAll, addAll, clear, clone, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCodeparallelStream, streampublic Range(String range)
public Range(Long index)
index - single index for this DimRange.public Range(Long start, Long end)
start - inclusive start valueend - inclusive end valuepublic Range(long[] values)
values - explicit list of values in this rangeCopyright © 2011–2026 SCIFIO. All rights reserved.