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 int |
MAXLENGTH |
static Slice |
SCALARSLICE |
static java.util.List<Slice> |
SCALARSLICES |
protected Slice.Sort |
sort |
static int |
UNDEFINED |
Constructor and Description |
---|
Slice() |
Slice(DapDimension dim) |
Slice(int first,
int stop,
int stride) |
Slice(int first,
int stop,
int stride,
int 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.
|
int |
getCount()
Compute the number of elements in
the slice.
|
int |
getFirst() |
int |
getLast() |
int |
getMax() |
int |
getSize() |
Slice.Sort |
getSort() |
int |
getStop() |
int |
getStride() |
Slice |
getSubSlice(int i) |
java.util.List<Slice> |
getSubSlices() |
int |
hashCode() |
java.lang.Boolean |
isConstrained() |
boolean |
isScalar() |
java.lang.Boolean |
isWhole() |
SliceIterator |
iterator() |
Slice |
setConstrained(java.lang.Boolean tf) |
Slice |
setIndices(int first,
int stop,
int stride) |
Slice |
setIndices(int first,
int stop,
int stride,
int maxsize) |
Slice |
setMaxSize(int 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 int UNDEFINED
public static final int MAXLENGTH
public static java.util.List<Slice> SCALARSLICES
public static Slice SCALARSLICE
protected Slice.Sort sort
protected boolean constrained
public Slice()
public Slice(int first, int stop, int stride) throws DapException
DapException
public Slice(int first, int stop, int stride, int 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 int getFirst()
public int getStop()
public int getLast()
public int getStride()
public int getSize()
public int getMax()
public boolean isScalar()
public Slice setMaxSize(int size) throws DapException
DapException
public Slice setIndices(int first, int stop, int stride) throws DapException
DapException
public Slice setIndices(int first, int stop, int stride, int 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 int 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)