Package org.planit.network.physical
Class ModeImpl
- java.lang.Object
-
- org.planit.network.physical.ModeImpl
-
- All Implemented Interfaces:
Comparable<Mode>
,Mode
public class ModeImpl extends Object implements Mode
A Mode is a user class feature representing a single form of transport (car, truck etc.).- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description ModeImpl(IdGroupingToken groupId, Object externalId, String name, double pcu)
ConstructorModeImpl(IdGroupingToken groupId, String name, double pcu)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Mode o)
Compare based on idObject
getExternalId()
Return the external id of this modelong
getId()
Return id of this instance.String
getName()
Name of this modedouble
getPcu()
Passenger car unit conversion factor for this modeboolean
hasExternalId()
Returns whether this mode has an external Id set
-
-
-
Constructor Detail
-
ModeImpl
public ModeImpl(IdGroupingToken groupId, String name, double pcu)
Constructor- Parameters:
groupId
- , contiguous id generation within this group for instances of this classname
- the name of this modepcu
- the PCU value of this mode
-
ModeImpl
public ModeImpl(IdGroupingToken groupId, Object externalId, String name, double pcu)
Constructor- Parameters:
groupId
- , contiguous id generation within this group for instances of this classexternalId
- the externalId of this modename
- the name of this modepcu
- the PCU value of this mode
-
-
Method Detail
-
getPcu
public double getPcu()
Description copied from interface:Mode
Passenger car unit conversion factor for this mode
-
getId
public long getId()
Description copied from interface:Mode
Return id of this instance. This id is expected to be generated using the org.planit.utils.misc.IdGenerator
-
getExternalId
public Object getExternalId()
Description copied from interface:Mode
Return the external id of this mode- Specified by:
getExternalId
in interfaceMode
- Returns:
- externalId of this mode
-
hasExternalId
public boolean hasExternalId()
Description copied from interface:Mode
Returns whether this mode has an external Id set- Specified by:
hasExternalId
in interfaceMode
- Returns:
- true if external Id set, false otherwise
-
compareTo
public int compareTo(Mode o)
Compare based on id- Specified by:
compareTo
in interfaceComparable<Mode>
- See Also:
Comparable.compareTo(java.lang.Object)
-
-