Package dap4.servlet
Class Odometer
- java.lang.Object
-
- dap4.servlet.Odometer
-
- All Implemented Interfaces:
Iterator<ucar.ma2.Index>
- Direct Known Subclasses:
MultiOdometer,ScalarOdometer
public class Odometer extends Object implements Iterator<ucar.ma2.Index>
A classic implementation of an odometer taken from the netcdf-c code. Extended to provide iterator interface
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classOdometer.STATE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<dap4.core.util.Slice>getSlices()List<Odometer>getSubOdometers()booleanhasNext()longindex()Compute the linear index from the current odometer indices.dap4.dap4lib.D4Indexindices()Return current set of indicesbooleanisMulti()booleanisScalar()dap4.dap4lib.D4Indexnext()intrank()Return odometer rankvoidremove()protected voidreset()dap4.core.util.Sliceslice(int i)Return ith sliceintstep(int firstpos, int lastpos)StringtoString()longtotalSize()Compute the total number of elements.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
state
protected Odometer.STATE state
-
rank
protected int rank
-
slices
protected List<dap4.core.util.Slice> slices
-
dimset
protected List<dap4.core.dmr.DapDimension> dimset
-
index
protected dap4.dap4lib.D4Index index
-
endpoint
protected long[] endpoint
-
-
Method Detail
-
reset
protected void reset()
-
rank
public int rank()
Return odometer rank
-
slice
public dap4.core.util.Slice slice(int i)
Return ith slice
-
getSlices
public List<dap4.core.util.Slice> getSlices()
-
index
public long index()
Compute the linear index from the current odometer indices.
-
indices
public dap4.dap4lib.D4Index indices()
Return current set of indices
-
totalSize
public long totalSize()
Compute the total number of elements.
-
step
public int step(int firstpos, int lastpos)
-
isMulti
public boolean isMulti()
-
isScalar
public boolean isScalar()
-
-