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 longcountprotected 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 booleanequals(Object o)Compare two slices for equalitySlicefinish()Perform sanity checks on a slice and repair where possible.longgetCount()Compute the number of elements in the slice.SlicegetSubSlice(int i)List<Slice>getSubSlices()inthashCode()SlicesetMaxSize(long size)StringtoConstraintString()Convert this multislice to a string suitable for use in a constraintStringtoString()-
Methods inherited from class dap4.core.util.Slice
compose, getFirst, getLast, getMax, getSize, getSort, getStop, getStride, isConstrained, 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:
toConstraintStringin classSlice- Returns:
- constraint usable string
- Throws:
DapException
-
finish
public Slice finish() throws DapException
Description copied from class:SlicePerform sanity checks on a slice and repair where possible.- Overrides:
finishin classSlice- Returns:
- this (fluent interface)
- Throws:
DapException- if slice is malformed
-
getSubSlices
public List<Slice> getSubSlices()
- Overrides:
getSubSlicesin classSlice
-
getSubSlice
public Slice getSubSlice(int i)
- Overrides:
getSubSlicein classSlice
-
getCount
public long getCount()
Description copied from class:SliceCompute the number of elements in the slice. Note that this is different from getStop() because stride is taken into account.
-
setMaxSize
public Slice setMaxSize(long size) throws DapException
- Overrides:
setMaxSizein classSlice- Throws:
DapException
-
-