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 LongDEFAULT_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 protectedModeImpl(IdGroupingToken groupId, double maxSpeed, String name, double pcu)Constructor, using all defaults for non-provided parametersprotectedModeImpl(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 booleanequals(Object o)StringgetExternalId()get external id of the entitylonggetId()collect id of the entitydoublegetMaximumSpeedKmH()maximum speed for this modeStringgetName()Name of this modedoublegetPcu()Passenger car unit conversion factor for this modePhysicalModeFeaturesgetPhysicalFeatures()collect the physical features of this modeUsabilityModeFeaturesgetUseFeatures()collect the features of how this mode is used (public, private etc.)StringgetXmlId()the id exposed to users as the "normal" id in the PLANit native xml formatbooleanhasExternalId()check if external id is available or notinthashCode()voidsetExternalId(String externalId)set the external idvoidsetXmlId(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:
getExternalIdin interfaceExternalIdable- Returns:
- external id
-
setExternalId
public void setExternalId(String externalId)
set the external id- Specified by:
setExternalIdin 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:
getXmlIdin interfaceExternalIdable- Returns:
- xmlId
-
setXmlId
public void setXmlId(String xmlId)
set the external id- Specified by:
setXmlIdin interfaceExternalIdable- Parameters:
xmlId- to set
-
hasExternalId
public boolean hasExternalId()
check if external id is available or not- Specified by:
hasExternalIdin 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:
getMaximumSpeedKmHin 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:
getPhysicalFeaturesin 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:
getUseFeaturesin interfaceMode- Returns:
- the use features of this mode
-
-