Package org.goplanit.utils.od
Class OdMatrixIterator<T,U>
- java.lang.Object
-
- org.goplanit.utils.od.OdMatrixIterator<T,U>
-
- Type Parameters:
T
- type of values in matrixU
- type of matrix container used
- All Implemented Interfaces:
Iterator<T>
,OdDataIterator<T>
- Direct Known Subclasses:
OdNonPrimitiveMatrixIterator
,OdPrimitiveMatrixIterator
public abstract class OdMatrixIterator<T,U> extends Object implements OdDataIterator<T>
BAse matrix oriented Iterator which runs through rows and columns of some matrix type of container, making the value, row and column of each cell available- Author:
- gman6028, markr
-
-
Field Summary
Fields Modifier and Type Field Description protected int
currentLocation
Marker used to store the current position in the OD matrix (used internally, not accessible from other classes)protected int
destinationId
Id of the destination zoneprotected int
originId
Id of the origin zoneprotected OdZones
zones
Zones object to store travel analysis zones (from Zoning object)
-
Constructor Summary
Constructors Constructor Description OdMatrixIterator(U matrixContents, OdZones zones)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Zone
getCurrentDestination()
Returns the destination zone object for the current cellZone
getCurrentOrigin()
Returns the origin zone object for the current cellprotected U
getMatrixContent()
Collect contents as typeboolean
hasNext()
Tests whether there are any more cells to iterate throughT
next()
protected void
updateCurrentLocation()
Increment the location cursor for the next iteration-
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
-
Methods inherited from interface org.goplanit.utils.od.OdDataIterator
getCurrentValue
-
-
-
-
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 for the next iteration
-
getMatrixContent
protected U getMatrixContent()
Collect contents as type- Returns:
- matrix content value
-
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:
getCurrentOrigin
in 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:
getCurrentDestination
in interfaceOdDataIterator<T>
- Returns:
- the destination zone object for the current cell
-
-