Package org.goplanit.output.property
Class OutputProperty
- java.lang.Object
-
- org.goplanit.output.property.OutputProperty
-
- All Implemented Interfaces:
Comparable<OutputProperty>
- Direct Known Subclasses:
CalculatedSpeedOutputProperty
,CapacityPerLaneOutputProperty
,CostTimesFlowOutputProperty
,DensityOutputProperty
,DestinationZoneExternalIdOutputProperty
,DestinationZoneIdOutputProperty
,DestinationZoneXmlIdOutputProperty
,DownstreamNodeExternalIdOutputProperty
,DownstreamNodeIdOutputProperty
,DownstreamNodeLocationOutputProperty
,DownstreamNodeXmlIdOutputProperty
,FlowOutputProperty
,InflowOutputProperty
,IterationIndexOutputProperty
,LengthOutputProperty
,LinkSegmentCostOutputProperty
,LinkSegmentExternalIdOutputProperty
,LinkSegmentIdOutputProperty
,LinkSegmentTypeIdOutputProperty
,LinkSegmentTypeNameOutputProperty
,LinkSegmentTypeXmlIdOutputProperty
,LinkSegmentXmlIdOutputProperty
,MaximumDensityOutputProperty
,MaximumSpeedOutputProperty
,ModeExternalIdOutputProperty
,ModeIdOutputProperty
,ModeXmlIdOutputProperty
,NumberOfLanesOutputProperty
,OdCostOutputProperty
,OriginZoneExternalIdOutputProperty
,OriginZoneIdOutputProperty
,OriginZoneXmlIdOutputProperty
,OutflowOutputProperty
,PathIdOutputProperty
,PathOutputStringProperty
,RunIdOutputProperty
,TimePeriodExternalIdOutputProperty
,TimePeriodIdOutputProperty
,TimePeriodXmlIdOutputProperty
,UpstreamNodeExternalIdOutputProperty
,UpstreamNodeIdOutputProperty
,UpstreamNodeLocationOutputProperty
,UpstreamNodeXmlIdOutputProperty
,VcRatioOutputProperty
public abstract class OutputProperty extends Object implements Comparable<OutputProperty>
Template for output property classes which can be included in the output files. All concrete output property classes must be final and extend this class.- Author:
- gman6028
-
-
Constructor Summary
Constructors Constructor Description OutputProperty()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(OutputProperty otherProperty)
compareTo method used to order the output columns when output is being writtenboolean
equals(Object otherProperty)
Overridden equals() method This method is needed to allow output properties to be removed from the output list if required.abstract OutputPropertyPriority
getColumnPriority()
Gets the column priority of the output property in output files The lower the column priority value of a property, the further to the left it is placed in the output fileabstract DataType
getDataType()
Returns the data type of the output propertyabstract Unit
getDefaultUnit()
Returns the units of the output propertyabstract String
getName()
Returns the name of the output propertyabstract OutputPropertyType
getOutputPropertyType()
Return the value of the OutputProperty enumeration for this propertyUnit
getOverrideUnit()
Only when the property allows a unit override and an override is set this method returns the proposed alternative unit to use.int
hashCode()
Overridden hashCode() method This method is needed to allow output properties to be removed from the output list if required.boolean
isUnitOverride()
Indicates if default units are overridden or not.static OutputProperty
of(String propertyClassName)
Generate the appropriate BaseOutputProperty object from a specified class namestatic OutputProperty
of(OutputPropertyType outputProperty)
Generate the appropriate BaseOutputProperty object from a specified enumeration valuevoid
setUnitOverride(Unit overrideUnit)
set the units to use for overriding the defaultsboolean
supportsUnitOverride()
An output property can be allowed to deviate from its default unit.
-
-
-
Method Detail
-
getName
public abstract String getName()
Returns the name of the output property- Returns:
- name of the output property
-
getDefaultUnit
public abstract Unit getDefaultUnit()
Returns the units of the output property- Returns:
- units of the output property
-
supportsUnitOverride
public boolean supportsUnitOverride()
An output property can be allowed to deviate from its default unit. In which case an override unit is to be made available. By default an output property is not allowed to deviate. So derived implementations must override this method to ensure it returns true if it does support this feature.- Returns:
- true when allowed, false otherwise
-
isUnitOverride
public boolean isUnitOverride()
Indicates if default units are overridden or not.- Returns:
- true when overridden, false otherwise
-
setUnitOverride
public void setUnitOverride(Unit overrideUnit)
set the units to use for overriding the defaults- Parameters:
overrideUnit
- units to use
-
getOverrideUnit
public Unit getOverrideUnit()
Only when the property allows a unit override and an override is set this method returns the proposed alternative unit to use. These units are required to be convertible from the original default unit to the proposed unit- Returns:
- proposed unit, original unit if none is set
-
getDataType
public abstract DataType getDataType()
Returns the data type of the output property- Returns:
- data type of the output property
-
getOutputPropertyType
public abstract OutputPropertyType getOutputPropertyType()
Return the value of the OutputProperty enumeration for this property- Returns:
- the value of the OutputProperty enumeration for this property
-
getColumnPriority
public abstract OutputPropertyPriority getColumnPriority()
Gets the column priority of the output property in output files The lower the column priority value of a property, the further to the left it is placed in the output file- Returns:
- the column priority
-
equals
public boolean equals(Object otherProperty)
Overridden equals() method This method is needed to allow output properties to be removed from the output list if required.
-
hashCode
public int hashCode()
Overridden hashCode() method This method is needed to allow output properties to be removed from the output list if required.
-
compareTo
public int compareTo(OutputProperty otherProperty)
compareTo method used to order the output columns when output is being written- Specified by:
compareTo
in interfaceComparable<OutputProperty>
- Parameters:
otherProperty
- output property which is being compared to the current one
-
of
public static OutputProperty of(String propertyClassName) throws PlanItException
Generate the appropriate BaseOutputProperty object from a specified class name- Parameters:
propertyClassName
- the class name of the specified output property- Returns:
- the BaseOutputProperty object corresponding to the specified enumeration value
- Throws:
PlanItException
- thrown if there is an error creating the object
-
of
public static OutputProperty of(OutputPropertyType outputProperty) throws PlanItException
Generate the appropriate BaseOutputProperty object from a specified enumeration value- Parameters:
outputProperty
- the enumeration value of the specified output property- Returns:
- the BaseOutputProperty object corresponding to the specified enumeration value
- Throws:
PlanItException
- thrown if there is an error creating the object
-
-