Package org.goplanit.network
Class Network
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<Network>
-
- org.goplanit.network.Network
-
- All Implemented Interfaces:
Serializable,Comparable<IdAble>,EventListener,PlanitComponentListener,EventListener,ExternalIdAble,IdAble
- Direct Known Subclasses:
LayeredNetwork,VirtualNetworkImpl
public abstract class Network extends PlanitComponent<Network> implements Serializable
Base class for any network. A network can be macroscopic or otherwise and in turn can be physical or not, etc. This all depends on its implementation. However in all cases it represents something that allows movement of one or more modes across the locations it represents.- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringMACROSCOPIC_NETWORKshorthand for creating a macroscopic infrastructure networkprotected IdGroupingTokennetworkIdGroupingTokena token for this network in particular to ensure unique ids across all entities of the same class instance within this network
-
Constructor Summary
Constructors Constructor Description Network(Network network, boolean deepCopy)Copy constructorNetwork(IdGroupingToken tokenId)Constructor
-
Method Summary
All Methods Instance Methods Abstract 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 entityabstract NetworkdeepClone()deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possibleIdGroupingTokengetNetworkGroupingTokenId()collect the grouping token for this network instanceabstract booleanisEmpty()Verify if entire network is emptyabstract voidlogInfo(String prefix)Log general information on this network to the uservoidreset()All components should be able to reset going back to some representative initial stateabstract NetworkshallowClone()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
-
networkIdGroupingToken
protected IdGroupingToken networkIdGroupingToken
a token for this network in particular to ensure unique ids across all entities of the same class instance within this network
-
MACROSCOPIC_NETWORK
public static final String MACROSCOPIC_NETWORK
shorthand for creating a macroscopic infrastructure network
-
-
Constructor Detail
-
Network
public Network(IdGroupingToken tokenId)
Constructor- Parameters:
tokenId- contiguous id generation within this group for instances of this class
-
Network
public Network(Network network, boolean deepCopy)
Copy constructor- Parameters:
network- to clonedeepCopy- when true, create a deep copy, shallow copy otherwise
-
-
Method Detail
-
getNetworkGroupingTokenId
public IdGroupingToken getNetworkGroupingTokenId()
collect the grouping token for this network instance- Returns:
- id grouping token
-
shallowClone
public abstract Network shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClonein interfaceIdAble- Specified by:
shallowClonein classPlanitComponent<Network>- Returns:
- shallow copy of entity
-
deepClone
public abstract Network deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible- Specified by:
deepClonein interfaceIdAble- Specified by:
deepClonein classPlanitComponent<Network>- Returns:
- deep copy of entity
-
reset
public void reset()
All components should be able to reset going back to some representative initial state- Specified by:
resetin classPlanitComponent<Network>
-
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:
collectSettingsAsKeyValueMapin classPlanitComponent<Network>- Returns:
- name-value map of all (user configurable) settings
-
logInfo
public abstract void logInfo(String prefix)
Log general information on this network to the user- Parameters:
prefix- to use
-
isEmpty
public abstract boolean isEmpty()
Verify if entire network is empty- Returns:
- true if network is empty, false otherwise
-
-