Package org.goplanit.utils.zoning
Interface Zones<Z extends Zone>
-
- Type Parameters:
Z
- zone type
- All Superinterfaces:
Iterable<Z>
,LongMapWrapper<Z>
,ManagedIdEntities<Z>
,MapWrapper<Long,Z>
- All Known Subinterfaces:
OdZones
,TransferZones
- All Known Implementing Classes:
OdZonesImpl
,TransferZonesImpl
,ZonesImpl
public interface Zones<Z extends Zone> extends ManagedIdEntities<Z>
Interface to manage zones- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Zones
deepClone()
Deep clone implementationZones
deepCloneWithMapping(BiConsumer<Z,Z> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapperdefault Z
getByXmlId(String xmlId)
Find the first entry with matching XML id, not efficient as not indexed by XML id, so use carefullydefault int
getNumberOfCentroids()
Each zone has exactly one centroid, so this is functionally equivalent to calling size()Zones
shallowClone()
Shallow clone implementation-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.goplanit.utils.wrapper.LongMapWrapper
get, remove
-
Methods inherited from interface org.goplanit.utils.id.ManagedIdEntities
containsKey, getFactory, getManagedIdClass, groupBy, recreateIds, recreateIds, reset, streamSortedBy
-
Methods inherited from interface org.goplanit.utils.wrapper.MapWrapper
addAll, clear, containsValue, firstMatch, forEachIn, get, getFirst, getKeyByValue, isEmpty, register, remove, removeAll, removeIf, size, stream, streamSorted, toCollection, toMap, valuesAsNewSet
-
-
-
-
Method Detail
-
getNumberOfCentroids
default int getNumberOfCentroids()
Each zone has exactly one centroid, so this is functionally equivalent to calling size()- Returns:
- number of centroids
-
getByXmlId
default Z getByXmlId(String xmlId)
Find the first entry with matching XML id, not efficient as not indexed by XML id, so use carefully- Parameters:
xmlId
- to find- Returns:
- zone found, null if not present
-
shallowClone
Zones shallowClone()
Shallow clone implementation- Specified by:
shallowClone
in interfaceManagedIdEntities<Z extends Zone>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,Z extends Zone>
- Returns:
- clone of entities
-
deepClone
Zones deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceManagedIdEntities<Z extends Zone>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
Zones deepCloneWithMapping(BiConsumer<Z,Z> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMapping
in interfaceManagedIdEntities<Z extends Zone>
- Parameters:
mapper
- to apply to each mapping between original and copy- Returns:
- copy
-
-