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 |
protected Slice.Sort |
sort |
static long |
UNDEFINED |
Constructor and Description |
---|
Slice() |
Slice(DapDimension dim) |
Slice(long first,
long last,
long stride) |
Slice(long first,
long last,
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.
|
java.util.List<Slice> |
getContiguous() |
long |
getCount()
Compute the number of elements int
the slice.
|
long |
getFirst() |
long |
getLast() |
long |
getMaxSize() |
Slice.Sort |
getSort() |
long |
getStop() |
long |
getStride() |
int |
hashCode() |
java.lang.Boolean |
isConstrained() |
boolean |
isContiguous() |
java.lang.Boolean |
isWhole() |
SliceIterator |
iterator() |
Slice |
setConstrained(java.lang.Boolean tf) |
Slice |
setIndices(long first,
long last,
long stride) |
Slice |
setIndices(long first,
long last,
long stride,
long maxsize) |
void |
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
protected Slice.Sort sort
protected boolean constrained
public Slice()
public Slice(long first, long last, long stride) throws DapException
DapException
public Slice(long first, long last, 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 getLast()
public long getStride()
public long getMaxSize()
public void setMaxSize(long size) throws DapException
DapException
public Slice setIndices(long first, long last, long stride) throws DapException
DapException
public Slice setIndices(long first, long last, 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 long getStop()
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 boolean isContiguous()
public java.util.List<Slice> getContiguous()
public static Slice compose(Slice target, Slice src) throws DapException
target
- src
- DapException