Package org.goplanit.mode
Class ModeFactoryImpl
- java.lang.Object
-
- org.goplanit.utils.id.ManagedIdEntityFactoryImpl<Mode>
-
- org.goplanit.mode.ModeFactoryImpl
-
- All Implemented Interfaces:
ManagedIdEntityFactory<Mode>,ModeFactory
public class ModeFactoryImpl extends ManagedIdEntityFactoryImpl<Mode> implements ModeFactory
Factory for creating modes on modes container- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected Modesmodesmodes container to use-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntityFactoryImpl
groupIdToken
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedModeFactoryImpl(IdGroupingToken groupId, Modes modes)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PredefinedModecreatePredefinedMode(IdGroupingToken groupId, PredefinedModeType modeType)create a predefined mode instance without registering it on the container.PredefinedModeregisterNew(PredefinedModeType modeType)Create and register a new predefined mode.ModeregisterNewCustomMode(String name, double maxSpeed, double pcu, PhysicalModeFeatures physicalFeatures, UsabilityModeFeatures usabilityFeatures)Create and register new mode-
Methods inherited from class org.goplanit.utils.id.ManagedIdEntityFactoryImpl
createUniqueCopyOf, getIdGroupingToken, setIdGroupingToken
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.ManagedIdEntityFactory
createUniqueCopyOf, getIdGroupingToken, setIdGroupingToken
-
-
-
-
Field Detail
-
modes
protected final Modes modes
modes container to use
-
-
Constructor Detail
-
ModeFactoryImpl
protected ModeFactoryImpl(IdGroupingToken groupId, Modes modes)
Constructor- Parameters:
groupId- to usemodes- to use
-
-
Method Detail
-
createPredefinedMode
public 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- Specified by:
createPredefinedModein interfaceModeFactory- Parameters:
groupId- the is generation tokenmodeType- predefined mode type to create- Returns:
- predefined mode instance
- Throws:
PlanItException- thrown if error
-
registerNewCustomMode
public Mode registerNewCustomMode(String name, double maxSpeed, double pcu, PhysicalModeFeatures physicalFeatures, UsabilityModeFeatures usabilityFeatures)
Create and register new mode- Specified by:
registerNewCustomModein interfaceModeFactory- 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
public PredefinedMode registerNew(PredefinedModeType modeType) throws PlanItException
Create and register a new predefined mode. When it already exists, the existing entry is returned- Specified by:
registerNewin interfaceModeFactory- Parameters:
modeType- the predefined mode type- Returns:
- new mode created, or existing mode when already present
- Throws:
PlanItException- thrown if error
-
-