Package org.planit.demands
Class Demands.UserClasses
- java.lang.Object
-
- org.planit.demands.Demands.UserClasses
-
-
Constructor Summary
Constructors Constructor Description UserClasses()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UserClasscreateAndRegisterNewUserClass(String name, Mode mode, TravelerType travellerType)Factory method to create and register a new user class on the demandsUserClassget(long id)Retrieve a user class by its idUserClassgetFirst()Collect the first registered user class.UserClassgetUserClassByXmlId(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.Iterator<UserClass>iterator()Iterator for user classes (non-sorted)protected voidregisterUserClass(UserClass userClass)Register a user classintsize()Collect the number of registered user classes-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
registerUserClass
protected void registerUserClass(UserClass userClass)
Register a user class- Parameters:
userClass- user class to be registered
-
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
-
size
public int size()
Collect the number of registered user classes- Returns:
- number of user classes
-
get
public UserClass get(long id)
Retrieve a user class by its id- Parameters:
id- id of the user class- Returns:
- retrieved user class
-
getFirst
public UserClass getFirst()
Collect the first registered user class.- Returns:
- first registered user class
-
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
-
-