Package org.goplanit.demands
Class Demands.UserClasses
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<UserClass>
-
- org.goplanit.demands.Demands.UserClasses
-
- All Implemented Interfaces:
Cloneable
,Iterable<UserClass>
,LongMapWrapper<UserClass>
,MapWrapper<Long,UserClass>
- Enclosing class:
- Demands
public class Demands.UserClasses extends LongMapWrapperImpl<UserClass>
Inner class to register and store user classes for the current demand object- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description UserClasses()
ConstructorUserClasses(Demands.UserClasses other)
Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear all entries from mapDemands.UserClasses
clone()
Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly createdUserClass
createAndRegisterNewUserClass(String name, Mode mode, TravelerType travellerType)
Factory method to create and register a new user class on the demandsUserClass
getUserClassByXmlId(String xmlId)
Retrieve a UserClass by its XML Id This method is not efficient, since it loops through all the registered user classes in order to find the required entry.-
Methods inherited from class org.goplanit.utils.wrapper.LongMapWrapperImpl
containsKey, get, remove
-
Methods inherited from class org.goplanit.utils.wrapper.MapWrapperImpl
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.MapWrapper
addAll, contains, findFirst, forEachIn, get, getFirst, getKeyByValue, isEmpty, register, remove, size, toCollection, valuesAsNewSet
-
-
-
-
Constructor Detail
-
UserClasses
public UserClasses()
Constructor
-
UserClasses
public UserClasses(Demands.UserClasses other)
Copy constructor- Parameters:
other
- to copy
-
-
Method Detail
-
createAndRegisterNewUserClass
public UserClass createAndRegisterNewUserClass(String name, Mode mode, TravelerType travellerType)
Factory method to create and register a new user class on the demands- Parameters:
name
- the name for this user classmode
- the mode for this user classtravellerType
- the travel type for this user class- Returns:
- new traveler type created
-
getUserClassByXmlId
public UserClass getUserClassByXmlId(String xmlId)
Retrieve a UserClass by its XML Id This method is not efficient, since it loops through all the registered user classes in order to find the required entry.- Parameters:
xmlId
- the XML Id of the specified user class- Returns:
- the retrieved user class, or null if no user class was found
-
clone
public Demands.UserClasses 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 interfaceMapWrapper<Long,UserClass>
- Specified by:
clone
in classLongMapWrapperImpl<UserClass>
- Returns:
- copy
-
clear
public void clear()
Clear all entries from map- Specified by:
clear
in interfaceMapWrapper<Long,UserClass>
- Overrides:
clear
in classMapWrapperImpl<Long,UserClass>
-
-