Class OdHashedIterator<T>

    • Field Detail

      • originId

        protected int originId
        Id of the origin zone
      • destinationId

        protected int destinationId
        Id of the destination zone
      • currentLocation

        protected int currentLocation
        Marker used to store the current position in the OD matrix (used internally, not accessible from other classes)
      • zones

        protected OdZones zones
        Zones object to store travel analysis zones (from Zoning object)
    • Constructor Detail

      • OdHashedIterator

        public OdHashedIterator​(OdHashed<T> container,
                                OdZones zones)
        Constructor
        Parameters:
        container - object containing the data to be iterated through
        zones - to use
    • Method Detail

      • updateCurrentLocation

        protected void updateCurrentLocation()
        Increment the location cursor until we reach a non-empty entry
      • hasNext

        public boolean hasNext()
        Tests whether there are any more cells to iterate through
        Specified by:
        hasNext in interface Iterator<T>
        Returns:
        true if there are more cells to iterate through, false otherwise
      • getCurrentOrigin

        public Zone getCurrentOrigin()
        Returns the origin zone object for the current cell
        Specified by:
        getCurrentOrigin in interface OdDataIterator<T>
        Returns:
        the origin zone object at the current cell
      • getCurrentDestination

        public Zone getCurrentDestination()
        Returns the destination zone object for the current cell
        Specified by:
        getCurrentDestination in interface OdDataIterator<T>
        Returns:
        the destination zone object for the current cell
      • next

        public T next()
        Specified by:
        next in interface Iterator<T>
      • getCurrentValue

        public T getCurrentValue()
        Returns the value at the current cell
        Specified by:
        getCurrentValue in interface OdDataIterator<T>
        Returns:
        the value at the current cell