Package org.goplanit.utils.mode
Interface ModeFactory
-
- All Superinterfaces:
ManagedIdEntityFactory<Mode>
- All Known Implementing Classes:
ModeFactoryImpl
public interface ModeFactory extends ManagedIdEntityFactory<Mode>
Factory interface for creating mode instances- Author:
- markr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PredefinedMode
createPredefinedMode(IdGroupingToken groupId, PredefinedModeType modeType)
create a predefined mode instance without registering it on the container.PredefinedMode
registerNew(PredefinedModeType modeType)
Create and register a new predefined mode.Mode
registerNewCustomMode(String name, double maxSpeed, double pcu, PhysicalModeFeatures physicalFeatures, UsabilityModeFeatures usabilityFeatures)
Create and register new mode-
Methods inherited from interface org.goplanit.utils.id.ManagedIdEntityFactory
createUniqueDeepCopyOf, createUniqueShallowCopyOf, getIdGroupingToken, setIdGroupingToken
-
-
-
-
Method Detail
-
registerNewCustomMode
Mode registerNewCustomMode(String name, double maxSpeed, double pcu, PhysicalModeFeatures physicalFeatures, UsabilityModeFeatures usabilityFeatures)
Create and register new mode- Parameters:
name
- of the modemaxSpeed
- maximum speed of the modepcu
- value for the modephysicalFeatures
- the physical features of this custom modeusabilityFeatures
- the usability features of this custom mode- Returns:
- new mode created
-
registerNew
PredefinedMode registerNew(PredefinedModeType modeType)
Create and register a new predefined mode. When it already exists, the existing entry is returned- Parameters:
modeType
- the predefined mode type- Returns:
- new mode created, or existing mode when already present
-
createPredefinedMode
PredefinedMode createPredefinedMode(IdGroupingToken groupId, PredefinedModeType modeType) throws PlanItException
create a predefined mode instance without registering it on the container. Use with caution as it can mess up the internal id structure if not registered subsequently- Parameters:
groupId
- the is generation tokenmodeType
- predefined mode type to create- Returns:
- predefined mode instance
- Throws:
PlanItException
- thrown if error
-
-