Package org.planit.mode
Class ModeImpl
- java.lang.Object
-
- org.planit.mode.ModeImpl
-
- All Implemented Interfaces:
Comparable<Idable>
,ExternalIdable
,Idable
,Mode
- Direct Known Subclasses:
PredefinedModeImpl
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
-
-
Field Summary
Fields Modifier and Type Field Description static Long
DEFAULT_EXTERNAL_ID
-
Fields inherited from interface org.planit.utils.mode.Mode
DEFAULT_XML_ID, GLOBAL_DEFAULT_MAXIMUM_SPEED_KMH, GLOBAL_DEFAULT_PCU
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ModeImpl(IdGroupingToken groupId, double maxSpeed, String name, double pcu)
Constructor, using all defaults for non-provided parametersprotected
ModeImpl(IdGroupingToken groupId, String name, double maxSpeed, double pcu, PhysicalModeFeatures physicalFeatures, UsabilityModeFeatures usabilityFeatures)
Constructor, using all defaults for non-provided parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getExternalId()
get external id of the entitylong
getId()
collect id of the entitydouble
getMaximumSpeedKmH()
maximum speed for this modeString
getName()
Name of this modedouble
getPcu()
Passenger car unit conversion factor for this modePhysicalModeFeatures
getPhysicalFeatures()
collect the physical features of this modeUsabilityModeFeatures
getUseFeatures()
collect the features of how this mode is used (public, private etc.)String
getXmlId()
the id exposed to users as the "normal" id in the PLANit native xml formatboolean
hasExternalId()
check if external id is available or notint
hashCode()
void
setExternalId(String externalId)
set the external idvoid
setXmlId(String xmlId)
set the external id-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.planit.utils.id.ExternalIdable
hasXmlId
-
Methods inherited from interface org.planit.utils.id.Idable
compareTo, idEquals, idHashCode
-
Methods inherited from interface org.planit.utils.mode.Mode
getPredefinedModeType, hasName, hasPhysicalFeatures, hasUseFeatures, isPredefinedModeType
-
-
-
-
Field Detail
-
DEFAULT_EXTERNAL_ID
public static final Long DEFAULT_EXTERNAL_ID
-
-
Constructor Detail
-
ModeImpl
protected ModeImpl(IdGroupingToken groupId, double maxSpeed, String name, double pcu)
Constructor, using all defaults for non-provided parameters- Parameters:
groupId
- , contiguous id generation within this group for instances of this classname
- the name of this modemaxSpeed
- this mode takes onpcu
- the PCU value of this mode
-
ModeImpl
protected ModeImpl(IdGroupingToken groupId, String name, double maxSpeed, double pcu, PhysicalModeFeatures physicalFeatures, UsabilityModeFeatures usabilityFeatures)
Constructor, using all defaults for non-provided parameters- Parameters:
groupId
- , contiguous id generation within this group for instances of this classname
- the name of this modemaxSpeed
- this mode takes onpcu
- the PCU value of this modephysicalFeatures
- physical features of the modeusabilityFeatures
- usability features of the mode
-
-
Method Detail
-
getId
public long getId()
collect id of the entity
-
getExternalId
public String getExternalId()
get external id of the entity- Specified by:
getExternalId
in interfaceExternalIdable
- Returns:
- external id
-
setExternalId
public void setExternalId(String externalId)
set the external id- Specified by:
setExternalId
in interfaceExternalIdable
- Parameters:
externalId
- to set
-
getXmlId
public String getXmlId()
the id exposed to users as the "normal" id in the PLANit native xml format- Specified by:
getXmlId
in interfaceExternalIdable
- Returns:
- xmlId
-
setXmlId
public void setXmlId(String xmlId)
set the external id- Specified by:
setXmlId
in interfaceExternalIdable
- Parameters:
xmlId
- to set
-
hasExternalId
public boolean hasExternalId()
check if external id is available or not- Specified by:
hasExternalId
in interfaceExternalIdable
- Returns:
- true when nont null, false otherwise
-
getName
public String getName()
Name of this mode
-
getMaximumSpeedKmH
public double getMaximumSpeedKmH()
maximum speed for this mode- Specified by:
getMaximumSpeedKmH
in interfaceMode
- Returns:
- maximum speed
-
getPcu
public double getPcu()
Passenger car unit conversion factor for this mode
-
getPhysicalFeatures
public final PhysicalModeFeatures getPhysicalFeatures()
collect the physical features of this mode- Specified by:
getPhysicalFeatures
in interfaceMode
- Returns:
- the physical mode features
-
getUseFeatures
public final UsabilityModeFeatures getUseFeatures()
collect the features of how this mode is used (public, private etc.)- Specified by:
getUseFeatures
in interfaceMode
- Returns:
- the use features of this mode
-
-