Class AccessAnyD.VectorView<N extends java.lang.Comparable<N>>

    • Field Detail

      • myCount

        private final long myCount
      • myDelegateAnyD

        private final AccessAnyD<N extends java.lang.Comparable<N>> myDelegateAnyD
      • myLastOffset

        private final long myLastOffset
      • myOffset

        private long myOffset
    • Constructor Detail

      • VectorView

        protected VectorView​(AccessAnyD<N> access)
      • VectorView

        VectorView​(AccessAnyD<N> access,
                   long index)
    • Method Detail

      • compareTo

        public int compareTo​(AccessAnyD.VectorView<N> other)
        Specified by:
        compareTo in interface java.lang.Comparable<N extends java.lang.Comparable<N>>
      • count

        public long count()
        Description copied from interface: Structure1D
        The total number of elements in this structure.

        You only need to implement this method if the structure can contain more than Integer.MAX_VALUE elements.

        Specified by:
        count in interface Structure1D
      • doubleValue

        public double doubleValue​(int index)
        Specified by:
        doubleValue in interface Access1D<N extends java.lang.Comparable<N>>
      • estimateSize

        public long estimateSize()
      • get

        public N get​(long index)
        Specified by:
        get in interface Access1D<N extends java.lang.Comparable<N>>
      • goToVector

        public void goToVector​(long index)
        Move the view to a specific vector. The index specified here should correspond to what is returned by the index() method.
        See Also:
        index()
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<N extends java.lang.Comparable<N>>
      • hasPrevious

        public boolean hasPrevious()
      • index

        public long index()
        If the underlying AccessAnyD data structure was created as 4x5x7, it can be viewed as 5x7 4-dimensional vectors. The size of the VectorView would be 4, and the index returned by this method indicates which of 5x7 vectors the view currently points to. The range of these indices would be 0-34.
        Returns:
        The index of the vector (which vector are we currently viewing).
      • iterator

        public AccessAnyD.VectorView<N> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<N extends java.lang.Comparable<N>>
      • next

        public AccessAnyD.VectorView<N> next()
        Specified by:
        next in interface java.util.Iterator<N extends java.lang.Comparable<N>>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<N extends java.lang.Comparable<N>>
      • size

        public int size()
        Description copied from interface: Structure1D
        The total number of elements in this structure.
        Specified by:
        size in interface Structure1D
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getOffset

        long getOffset()