Package org.goplanit.path
Class OdPathSets
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<OdPathSets>
-
- org.goplanit.path.OdPathSets
-
- All Implemented Interfaces:
Serializable
,Comparable<IdAble>
,EventListener
,PlanitComponentListener
,EventListener
,ExternalIdAble
,IdAble
public class OdPathSets extends PlanitComponent<OdPathSets> implements Serializable
Contains one or more origin-destination based path sets that can be used in assignment. For now each individual path set takes on the form of the already available ODPathMatrix. In future versions more flexible implementation are planned- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected TreeMap<Long,OdPathMatrix>
odPathMatrices
map holding all registered od path matrices by their unique id
-
Constructor Summary
Constructors Constructor Description OdPathSets(OdPathSets other, boolean deepCopy)
ConstructorOdPathSets(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
collectSettingsAsKeyValueMap()
Provide all the settings of this particular component by name and value, where each value is a string representation of the underlying entityOdPathMatrix
createAndRegisterOdPathMatrix(Zoning zoning)
Create an empty od path matrix and register it on this od path setsOdPathSets
deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possibleOdPathMatrix
getFirstOdPathMatrix()
Collect the first od path matrix availableint
getNumberOfOdPathSets()
Collect the number of registered od path setsBoolean
hasRegisteredOdMatrices()
verify if any od path matrices have been registered or notvoid
registerOdPathMatrix(OdPathMatrix odPathMatrix)
register the passed in path matrix (not copied)void
reset()
remove all registered path sets.OdPathSets
shallowClone()
Create a shallow copy of this entity-
Methods inherited from class org.goplanit.component.PlanitComponent
equals, getComponentType, getExternalId, getId, getIdGroupingToken, getKnownSupportedEventTypes, getXmlId, hashCode, onPlanitComponentEvent, setExternalId, setXmlId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.event.EventListener
hasKnownSupportedEventTypes
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, hasExternalId, hasXmlId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, idEquals, idHashCode
-
-
-
-
Field Detail
-
odPathMatrices
protected final TreeMap<Long,OdPathMatrix> odPathMatrices
map holding all registered od path matrices by their unique id
-
-
Constructor Detail
-
OdPathSets
public OdPathSets(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- contiguous id generation within this group for instances of this class
-
OdPathSets
public OdPathSets(OdPathSets other, boolean deepCopy)
Constructor- Parameters:
other
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwise
-
-
Method Detail
-
getNumberOfOdPathSets
public int getNumberOfOdPathSets()
Collect the number of registered od path sets- Returns:
- number of od path sets
-
createAndRegisterOdPathMatrix
public OdPathMatrix createAndRegisterOdPathMatrix(Zoning zoning)
Create an empty od path matrix and register it on this od path sets- Parameters:
zoning
- used to derive the size of the aquare zone based matrix- Returns:
- newly created od path matrix
-
registerOdPathMatrix
public void registerOdPathMatrix(OdPathMatrix odPathMatrix)
register the passed in path matrix (not copied)- Parameters:
odPathMatrix
- to register
-
hasRegisteredOdMatrices
public Boolean hasRegisteredOdMatrices()
verify if any od path matrices have been registered or not- Returns:
- true if any are registered, false otherwise
-
getFirstOdPathMatrix
public OdPathMatrix getFirstOdPathMatrix()
Collect the first od path matrix available- Returns:
- the first od path matrix available, if not available null is returned
-
shallowClone
public OdPathSets shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in classPlanitComponent<OdPathSets>
- Returns:
- shallow copy of entity
-
deepClone
public OdPathSets deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible- Specified by:
deepClone
in interfaceIdAble
- Specified by:
deepClone
in classPlanitComponent<OdPathSets>
- Returns:
- deep copy of entity
-
reset
public void reset()
remove all registered path sets. Note that this does not reset the path ids since this component does not own or represents the managed paths container- Specified by:
reset
in classPlanitComponent<OdPathSets>
-
collectSettingsAsKeyValueMap
public Map<String,String> collectSettingsAsKeyValueMap()
Provide all the settings of this particular component by name and value, where each value is a string representation of the underlying entity- Specified by:
collectSettingsAsKeyValueMap
in classPlanitComponent<OdPathSets>
- Returns:
- name-value map of all (user configurable) settings
-
-