public class Slice
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Slice.Sort |
Modifier and Type | Field and Description |
---|---|
protected boolean |
constrained
Indicate that this slice's first/last/stride were
specifically set; typically from a constraint.
|
static long |
MAXLENGTH |
static Slice |
SCALARSLICE |
static java.util.List<Slice> |
SCALARSLICES |
protected Slice.Sort |
sort |
static long |
UNDEFINED |
Constructor and Description |
---|
Slice() |
Slice(DapDimension dim) |
Slice(long first,
long stop,
long stride) |
Slice(long first,
long stop,
long stride,
long maxsize) |
Slice(Slice s) |
Modifier and Type | Method and Description |
---|---|
static Slice |
compose(Slice target,
Slice src)
Take two slices and compose src wrt target
Assume neither argument is null.
|
boolean |
equals(java.lang.Object o)
Compare two slices for equality
|
Slice |
finish()
Perform sanity checks on a slice and repair where possible.
|
long |
getCount()
Compute the number of elements in
the slice.
|
long |
getFirst() |
long |
getLast() |
long |
getMax() |
long |
getSize() |
Slice.Sort |
getSort() |
long |
getStop() |
long |
getStride() |
Slice |
getSubSlice(int i) |
java.util.List<Slice> |
getSubSlices() |
int |
hashCode() |
java.lang.Boolean |
isConstrained() |
java.lang.Boolean |
isWhole() |
SliceIterator |
iterator() |
Slice |
setConstrained(java.lang.Boolean tf) |
Slice |
setIndices(long first,
long stop,
long stride) |
Slice |
setIndices(long first,
long stop,
long stride,
long maxsize) |
Slice |
setMaxSize(long size) |
Slice |
setWhole(java.lang.Boolean tf) |
java.lang.String |
toConstraintString()
Convert this slice to a string
suitable for use in a constraint
|
java.lang.String |
toString() |
java.lang.String |
toString(boolean withbrackets) |
public static final long UNDEFINED
public static final long MAXLENGTH
public static java.util.List<Slice> SCALARSLICES
public static Slice SCALARSLICE
protected Slice.Sort sort
protected boolean constrained
public Slice()
public Slice(long first, long stop, long stride) throws DapException
DapException
public Slice(long first, long stop, long stride, long maxsize) throws DapException
DapException
public Slice(Slice s) throws DapException
DapException
public Slice(DapDimension dim) throws DapException
DapException
public Slice finish() throws DapException
DapException
- if slice is malformedpublic SliceIterator iterator()
public Slice.Sort getSort()
public long getFirst()
public long getStop()
public long getLast()
public long getStride()
public long getSize()
public long getMax()
public Slice setMaxSize(long size) throws DapException
DapException
public Slice setIndices(long first, long stop, long stride) throws DapException
DapException
public Slice setIndices(long first, long stop, long stride, long maxsize) throws DapException
DapException
public java.lang.Boolean isWhole()
public Slice setWhole(java.lang.Boolean tf)
public java.lang.Boolean isConstrained()
public Slice setConstrained(java.lang.Boolean tf)
public long getCount()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the other slice to compare withpublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(boolean withbrackets)
public java.lang.String toConstraintString() throws DapException
DapException
public static Slice compose(Slice target, Slice src) throws DapException
target
- src
- DapException
public java.util.List<Slice> getSubSlices()
public Slice getSubSlice(int i)