U
- the linear Unit.public abstract class LinearUnit<U extends LinearUnit<U>> extends Unit<U>
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
STANDARD_UNITS
Modifier | Constructor and Description |
---|---|
|
LinearUnit(String nameOrNameKey,
String abbreviationOrAbbreviationKey,
UnitSystem unitSystem,
boolean standardUnit)
Build a standard linear unit and create the fields for a unit.
|
protected |
LinearUnit(String nameOrNameKey,
String abbreviationOrAbbreviationKey,
UnitSystem unitSystem,
Scale scale,
boolean standardUnit)
Build a unit with a specific conversion scale to/from the standard unit.
|
protected |
LinearUnit(String nameOrNameKey,
String abbreviationOrAbbreviationKey,
UnitSystem unitSystem,
U referenceUnit,
double scaleFactorToReferenceUnit,
boolean standardUnit)
Build a unit with a linear conversion factor to another unit.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
boolean |
equalsIgnoreNaming(Object obj)
Test if two units are the same, except for the name and abbreviation.
|
LinearScale |
getScale() |
double |
getScaleFactor() |
int |
hashCode() |
generateHashCode, getAbbreviation, getAbbreviationKey, getAllUnitsOfThisType, getName, getNameKey, getSICoefficients, getSICoefficientsString, getStandardUnit, getUnits, getUnitSystem, isBaseSIUnit, isLocalizable, lookupOrCreateSIUnitWithSICoefficients, lookupOrCreateUnitWithSICoefficients, lookupUnitWithSICoefficients, toString
public LinearUnit(String nameOrNameKey, String abbreviationOrAbbreviationKey, UnitSystem unitSystem, boolean standardUnit)
nameOrNameKey
- if standardUnit: the key to the locale file for the long name of the unit, otherwise the name itselfabbreviationOrAbbreviationKey
- if standardUnit: the key to the locale file for the abbreviation of the unit,
otherwise the abbreviation itselfunitSystem
- the unit system, e.g. SI or ImperialstandardUnit
- indicates whether it is a standard unit with a definition in the locale, or a user-defined unitprotected LinearUnit(String nameOrNameKey, String abbreviationOrAbbreviationKey, UnitSystem unitSystem, U referenceUnit, double scaleFactorToReferenceUnit, boolean standardUnit)
nameOrNameKey
- if standardUnit: the key to the locale file for the long name of the unit, otherwise the name itselfabbreviationOrAbbreviationKey
- if standardUnit: the key to the locale file for the abbreviation of the unit,
otherwise the abbreviation itselfunitSystem
- the unit system, e.g. SI or ImperialreferenceUnit
- the unit to convert toscaleFactorToReferenceUnit
- multiply a value in this unit by the factor to convert to the given reference unitstandardUnit
- indicates whether it is a standard unit with a definition in the locale, or a user-defined unitprotected LinearUnit(String nameOrNameKey, String abbreviationOrAbbreviationKey, UnitSystem unitSystem, Scale scale, boolean standardUnit)
nameOrNameKey
- if standardUnit: the key to the locale file for the long name of the unit, otherwise the name itselfabbreviationOrAbbreviationKey
- if standardUnit: the key to the locale file for the abbreviation of the unit,
otherwise the abbreviation itselfunitSystem
- the unit system, e.g. SI or Imperialscale
- the conversion scale to use for this unitstandardUnit
- indicates whether it is a standard unit with a definition in the locale, or a user-defined unitpublic LinearScale getScale()
getScale
in class Unit<U extends LinearUnit<U>>
public final double getScaleFactor()
public int hashCode()
hashCode
in class Unit<U extends LinearUnit<U>>
public boolean equalsIgnoreNaming(Object obj)
equalsIgnoreNaming
in class Unit<U extends LinearUnit<U>>
obj
- the object to compare withCopyright © 2015–2018 Delft University of Technology. All rights reserved.