Package org.planit.od
Class ODDataIteratorImpl<T>
- java.lang.Object
-
- org.planit.od.ODDataIteratorImpl<T>
-
- Type Parameters:
T
- the type of data to be stored for each origin-destination cell
- All Implemented Interfaces:
Iterator<T>
,ODDataIterator<T>
- Direct Known Subclasses:
ODMatrixIterator
,ODPathIterator
public abstract class ODDataIteratorImpl<T> extends Object implements ODDataIterator<T>
Base class containing common methods required by all classes which implement ODDataIterator- Author:
- gman6028
-
-
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 Zones<?>
zones
Zones object to store travel analysis zones (from Zoning object)
-
Constructor Summary
Constructors Constructor Description ODDataIteratorImpl(Zones<?> 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 cellboolean
hasNext()
Tests whether there are any more cells to iterate throughprotected 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, next, remove
-
Methods inherited from interface org.planit.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 Zones<?> zones
Zones object to store travel analysis zones (from Zoning object)
-
-
Constructor Detail
-
ODDataIteratorImpl
public ODDataIteratorImpl(Zones<?> zones)
Constructor- Parameters:
zones
- zones considered in the matrix
-
-
Method Detail
-
updateCurrentLocation
protected void updateCurrentLocation()
Increment the location cursor for the next iteration
-
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
-
-