Package dap4.core.util
Class MultiSlice
- java.lang.Object
-
- dap4.core.util.Slice
-
- dap4.core.util.MultiSlice
-
public class MultiSlice extends Slice
A MultiSlice is a list of slices to support e.g. [x:y,a:b] It subclasses Slice so it can appear in same places slices do; code is expected to differentiate.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class dap4.core.util.Slice
Slice.Sort
-
-
Field Summary
Fields Modifier and Type Field Description protected int
count
protected List<Slice>
subslices
-
Fields inherited from class dap4.core.util.Slice
constrained, MAXLENGTH, SCALARSLICE, SCALARSLICES, sort, UNDEFINED
-
-
Constructor Summary
Constructors Constructor Description MultiSlice(List<Slice> subslices)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Compare two slices for equalitySlice
finish()
Perform sanity checks on a slice and repair where possible.int
getCount()
Compute the number of elements in the slice.Slice
getSubSlice(int i)
List<Slice>
getSubSlices()
int
hashCode()
Slice
setMaxSize(int size)
String
toConstraintString()
Convert this multislice to a string suitable for use in a constraintString
toString()
-
Methods inherited from class dap4.core.util.Slice
compose, getFirst, getLast, getMax, getSize, getSort, getStop, getStride, isConstrained, isScalar, isWhole, iterator, setConstrained, setIndices, setIndices, setWhole, toString
-
-
-
-
Constructor Detail
-
MultiSlice
public MultiSlice(List<Slice> subslices) throws DapException
- Throws:
DapException
-
-
Method Detail
-
equals
public boolean equals(Object o)
Compare two slices for equality
-
toConstraintString
public String toConstraintString() throws DapException
Convert this multislice to a string suitable for use in a constraint- Overrides:
toConstraintString
in classSlice
- Returns:
- constraint usable string
- Throws:
DapException
-
finish
public Slice finish() throws DapException
Description copied from class:Slice
Perform sanity checks on a slice and repair where possible.- Overrides:
finish
in classSlice
- Returns:
- this (fluent interface)
- Throws:
DapException
- if slice is malformed
-
getSubSlices
public List<Slice> getSubSlices()
- Overrides:
getSubSlices
in classSlice
-
getSubSlice
public Slice getSubSlice(int i)
- Overrides:
getSubSlice
in classSlice
-
getCount
public int getCount()
Description copied from class:Slice
Compute the number of elements in the slice. Note that this is different from getStop() because stride is taken into account.
-
setMaxSize
public Slice setMaxSize(int size) throws DapException
- Overrides:
setMaxSize
in classSlice
- Throws:
DapException
-
-