Interface RoutedServicesLayer
-
- All Superinterfaces:
Comparable<IdAble>
,ExternalIdAble
,IdAble
,Iterable<RoutedModeServices>
,ManagedId
- All Known Implementing Classes:
RoutedServicesLayerImpl
public interface RoutedServicesLayer extends ManagedId, ExternalIdAble, Iterable<RoutedModeServices>
Interface to reflect a routed services layer which in turn is to be managed by a container class that implements the RoutedServicesLayers interface. A RoutedServiceLayer contains routed services for a given parent service network layer such as for example - but not limited to - bus routes, train lines etc.- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static Class<RoutedServicesLayer>
ROUTED_SERVICES_LAYER_ID_CLASS
id class for generating ids
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description RoutedServicesLayer
deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call.default Class<RoutedServicesLayer>
getIdClass()
Each managed id class is expected to generate its ids based on its class signature.RoutedServicesLayerModifier
getLayerModifier()
Routed services have an additional modifier options to provided integrated utilities for changing the routed services in a way that updates all attached managed routed and service network elements involvedServiceNetworkLayer
getParentLayer()
The parent service layer of this routed services layerRoutedModeServices
getServicesByMode(Mode mode)
The services for a given mode available on this layer.default Collection<Mode>
getSupportedModes()
Collect the supported modes that potentially have services registered based on the parent layerdefault Collection<Mode>
getSupportedModesWithServices()
Collect the modes for which a RoutedModeService entry is available, i.e., for which we expect services to exist rather than potentially support.boolean
isEmpty()
Check if the layer is empty of any routed servicesboolean
isServicesByModeEmpty(Mode mode)
Verify if there exist no registered services for a given mode at all at presentvoid
logInfo(String prefix)
invoked by entities inquiring about general information about the layer to display to usersdefault void
resetChildManagedIdEntities()
Each class that has a managed id, should be able to reset any children that themselves are managedIdEntity containers.RoutedServicesLayer
shallowClone()
Create a shallow copy of this entity-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
recreateManagedIds
-
-
-
-
Field Detail
-
ROUTED_SERVICES_LAYER_ID_CLASS
static final Class<RoutedServicesLayer> ROUTED_SERVICES_LAYER_ID_CLASS
id class for generating ids
-
-
Method Detail
-
getIdClass
default Class<RoutedServicesLayer> getIdClass()
Each managed id class is expected to generate its ids based on its class signature. To be able to generate the correct id the class used for id generation is to be provided via this method call.- Specified by:
getIdClass
in interfaceManagedId
- Returns:
- idClass to use for generating ids for instances of this idable derived class
-
logInfo
void logInfo(String prefix)
invoked by entities inquiring about general information about the layer to display to users- Parameters:
prefix
- optional prefix to include in each line of logging
-
isEmpty
boolean isEmpty()
Check if the layer is empty of any routed services- Returns:
- true when empty, false otherwise
-
getParentLayer
ServiceNetworkLayer getParentLayer()
The parent service layer of this routed services layer- Returns:
- parent layer
-
isServicesByModeEmpty
boolean isServicesByModeEmpty(Mode mode)
Verify if there exist no registered services for a given mode at all at present- Parameters:
mode
- to check- Returns:
- true when no single routed service by mode exists, false otherwise
-
getServicesByMode
RoutedModeServices getServicesByMode(Mode mode)
The services for a given mode available on this layer. If no services are yet available an empty instance is created and registered. It is expected that each routed service across all modes on the layer has a unique internal id, so internal ids do not restart at zero per mode- Parameters:
mode
- to obtain services for- Returns:
- services by mode, empty instance if none have been registered yet
-
resetChildManagedIdEntities
default void resetChildManagedIdEntities()
Each class that has a managed id, should be able to reset any children that themselves are managedIdEntity containers. This ensures that when resetting such a container any child containers are also reset- Specified by:
resetChildManagedIdEntities
in interfaceManagedId
-
getSupportedModes
default Collection<Mode> getSupportedModes()
Collect the supported modes that potentially have services registered based on the parent layer- Returns:
- supported modes
-
getSupportedModesWithServices
default Collection<Mode> getSupportedModesWithServices()
Collect the modes for which a RoutedModeService entry is available, i.e., for which we expect services to exist rather than potentially support. this method does not look at the parent layer supported modes, but only at the modes for which a routed services container exists.- Returns:
- available modes
-
getLayerModifier
RoutedServicesLayerModifier getLayerModifier()
Routed services have an additional modifier options to provided integrated utilities for changing the routed services in a way that updates all attached managed routed and service network elements involved- Returns:
- routed services layer modifier
-
shallowClone
RoutedServicesLayer shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Returns:
- shallow copy of entity
-
deepClone
RoutedServicesLayer deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code
-
-