Package dap4.servlet

Class 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
    • Field Detail

      • 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
    • Constructor Detail

      • Odometer

        protected Odometer()
      • Odometer

        public Odometer​(List<dap4.core.util.Slice> set,
                        List<dap4.core.dmr.DapDimension> dimset)
                 throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
    • 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.
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<ucar.ma2.Index>
      • next

        public dap4.dap4lib.D4Index next()
        Specified by:
        next in interface Iterator<ucar.ma2.Index>
      • remove

        public void remove()
        Specified by:
        remove in interface Iterator<ucar.ma2.Index>
      • step

        public int step​(int firstpos,
                        int lastpos)
      • isMulti

        public boolean isMulti()
      • isScalar

        public boolean isScalar()