Package org.planit.network.physical
Class PhysicalNetwork.Modes
- java.lang.Object
-
- org.planit.network.physical.PhysicalNetwork.Modes
-
-
Constructor Summary
Constructors Constructor Description Modes()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mode
getFirst()
Collect the first registered modeMode
getModeByExternalId(Object externalId)
Retrieve a Mode by its external Id This method is not efficient, since it loops through all the registered modes in order to find the required time period.Mode
getModeByExternalId(Object externalId, boolean convertToLong)
Retrieve a Mode by its external Id This method has the option to convert the external Id parameter into a long value, to find the mode when mode objects use long values for external ids.Mode
getModeById(long id)
Return a Mode by its idint
getNumberOfModes()
Return number of registered modesIterator<Mode>
iterator()
Iterator over available modesprotected Mode
registerMode(Mode mode)
Add mode to the internal containerMode
registerNewMode(long externalModeId, String name, double pcu)
Create and register new mode-
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
-
registerMode
protected Mode registerMode(Mode mode)
Add mode to the internal container- Parameters:
mode
- to be registered in this network- Returns:
- mode, in case it overrides an existing mode, the removed mode is returned
-
registerNewMode
public Mode registerNewMode(long externalModeId, String name, double pcu)
Create and register new mode- Parameters:
externalModeId
- the external mode id for the modename
- of the modepcu
- value for the mode- Returns:
- new mode created
-
getNumberOfModes
public int getNumberOfModes()
Return number of registered modes- Returns:
- number of registered modes
-
getModeById
public Mode getModeById(long id)
Return a Mode by its id- Parameters:
id
- the id of the Mode- Returns:
- the specified mode
-
getFirst
public Mode getFirst()
Collect the first registered mode- Returns:
- first registered mode if any
-
getModeByExternalId
public Mode getModeByExternalId(Object externalId, boolean convertToLong)
Retrieve a Mode by its external Id This method has the option to convert the external Id parameter into a long value, to find the mode when mode objects use long values for external ids.- Parameters:
externalId
- the external Id of the specified modeconvertToLong
- if true, the external Id is converted into a long before beginning the search- Returns:
- the retrieved mode, or null if no mode was found
-
getModeByExternalId
public Mode getModeByExternalId(Object externalId)
Retrieve a Mode by its external Id This method is not efficient, since it loops through all the registered modes in order to find the required time period. The equivalent method in InputBuilderListener is more efficient and should be used in preference to this in Java code.- Parameters:
externalId
- the external Id of the specified mode- Returns:
- the retrieved mode, or null if no mode was found
-
-