Package org.planit.utils.zoning
Interface Zones<Z extends Zone>
-
- Type Parameters:
Z
- zone type
- All Superinterfaces:
Iterable<Z>
- All Known Implementing Classes:
OdZonesImpl
,TransferZonesImpl
,ZonesImpl
public interface Zones<Z extends Zone> extends Iterable<Z>
- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Zone
get(long id)
Retrieve zone by its Iddefault int
getNumberOfCentroids()
each zone has exactly one centroid, so this is functionally equivalent to callingsize()
default boolean
isEmpty()
check if no zones are registered, i.e., size=0Zone
register(Z zone)
Add zone to the internal container.Z
registerNew()
Create and register new zoneint
size()
Collect number of zones-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
register
Zone register(Z zone)
Add zone to the internal container. Use carefully to avoid issues with internal contiguous ids- Parameters:
zone
- the zone to be added- Returns:
- the zone added
-
registerNew
Z registerNew()
Create and register new zone- Returns:
- the new zone created
-
get
Zone get(long id)
Retrieve zone by its Id- Parameters:
id
- the id of the zone- Returns:
- zone the zone retrieved
-
size
int size()
Collect number of zones- Returns:
- the number of zones
-
isEmpty
default boolean isEmpty()
check if no zones are registered, i.e., size=0- Returns:
- true when empty, false otherwise
-
getNumberOfCentroids
default int getNumberOfCentroids()
each zone has exactly one centroid, so this is functionally equivalent to callingsize()
- Returns:
- number of centroids
-
-