Package org.goplanit.mode
Class ModesImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.id.ManagedIdEntitiesImpl<Mode>
-
- org.goplanit.mode.ModesImpl
-
- All Implemented Interfaces:
Cloneable
,Iterable<Mode>
,ManagedIdEntities<Mode>
,Modes
,LongMapWrapper<Mode>
,MapWrapper<Long,Mode>
public class ModesImpl extends ManagedIdEntitiesImpl<Mode> implements Modes
Implementation of the Modes interface to create and register modes- Author:
- mark
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description ModesImpl(ModesImpl modesImpl)
Copy ConstructorModesImpl(IdGroupingToken groupId)
ConstructorModesImpl(ModeFactory modeFactory)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModesImpl
clone()
Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly createdboolean
containsPredefinedMode(PredefinedModeType modeType)
verify if predefined mode is registeredPredefinedMode
get(PredefinedModeType modeType)
get predefined mode if it is registeredMode
getByXmlId(String xmlId)
Retrieve a Mode by its XML IdModeFactory
getFactory()
Collect the mode factory to use for creating instances-
Methods inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
getManagedIdClass, recreateIds, reset, updateIdMapping
-
Methods inherited from class org.goplanit.utils.wrapper.LongMapWrapperImpl
containsKey, get, remove
-
Methods inherited from class org.goplanit.utils.wrapper.MapWrapperImpl
clear, contains, createEmptyInstance, findFirst, get, getKeyByValue, getMap, getValueToKey, isEmpty, iterator, register, remove, setMap, size, toCollection, valuesAsNewSet
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.goplanit.utils.wrapper.LongMapWrapper
get, remove
-
Methods inherited from interface org.goplanit.utils.id.ManagedIdEntities
containsKey, getManagedIdClass, recreateIds, recreateIds, reset
-
Methods inherited from interface org.goplanit.utils.wrapper.MapWrapper
addAll, clear, contains, findFirst, forEachIn, get, getFirst, getKeyByValue, isEmpty, register, remove, size, toCollection, valuesAsNewSet
-
-
-
-
Constructor Detail
-
ModesImpl
public ModesImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- to use for creating ids for instances
-
ModesImpl
public ModesImpl(ModeFactory modeFactory)
Constructor- Parameters:
modeFactory
- factory to use
-
ModesImpl
public ModesImpl(ModesImpl modesImpl)
Copy Constructor- Parameters:
modesImpl
- to copy
-
-
Method Detail
-
containsPredefinedMode
public boolean containsPredefinedMode(PredefinedModeType modeType)
verify if predefined mode is registered- Specified by:
containsPredefinedMode
in interfaceModes
- Parameters:
modeType
- to verify- Returns:
- true when available, false otherwise
-
get
public PredefinedMode get(PredefinedModeType modeType)
get predefined mode if it is registered
-
getByXmlId
public Mode getByXmlId(String xmlId)
Retrieve a Mode by its XML Id- Specified by:
getByXmlId
in interfaceModes
- Parameters:
xmlId
- the XML Id of the specified mode- Returns:
- the retrieved mode, or null if no mode was found
-
clone
public ModesImpl clone()
Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly created- Specified by:
clone
in interfaceManagedIdEntities<Mode>
- Specified by:
clone
in interfaceMapWrapper<Long,Mode>
- Specified by:
clone
in interfaceModes
- Specified by:
clone
in classManagedIdEntitiesImpl<Mode>
- Returns:
- copy
-
getFactory
public ModeFactory getFactory()
Collect the mode factory to use for creating instances- Specified by:
getFactory
in interfaceManagedIdEntities<Mode>
- Specified by:
getFactory
in interfaceModes
- Returns:
- modeFactory to create modes for this container
-
-