Package org.goplanit.utils.od
Class OdHashedIterator<T>
- java.lang.Object
-
- org.goplanit.utils.od.OdHashedIterator<T>
-
- Type Parameters:
T- type of values
- All Implemented Interfaces:
Iterator<T>,OdDataIterator<T>
- Direct Known Subclasses:
OdPathsHashed.OdPathsHashedIterator
public abstract class OdHashedIterator<T> extends Object implements OdDataIterator<T>
Base Hash key oriented Iterator which runs through available ods that have non-zero values- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected intcurrentLocationMarker used to store the current position in the OD matrix (used internally, not accessible from other classes)protected intdestinationIdId of the destination zoneprotected intoriginIdId of the origin zoneprotected OdZoneszonesZones object to store travel analysis zones (from Zoning object)
-
Constructor Summary
Constructors Constructor Description OdHashedIterator(OdHashed<T> container, OdZones zones)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ZonegetCurrentDestination()Returns the destination zone object for the current cellZonegetCurrentOrigin()Returns the origin zone object for the current cellTgetCurrentValue()Returns the value at the current cellbooleanhasNext()Tests whether there are any more cells to iterate throughTnext()protected voidupdateCurrentLocation()Increment the location cursor until we reach a non-empty entry-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
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)
-
-
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
-
getCurrentOrigin
public Zone getCurrentOrigin()
Returns the origin zone object for the current cell- Specified by:
getCurrentOriginin interfaceOdDataIterator<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:
getCurrentDestinationin interfaceOdDataIterator<T>- Returns:
- the destination zone object for the current cell
-
getCurrentValue
public T getCurrentValue()
Returns the value at the current cell- Specified by:
getCurrentValuein interfaceOdDataIterator<T>- Returns:
- the value at the current cell
-
-