U - the linear Unit.public abstract class LinearUnit<U extends LinearUnit<U>> extends Unit<U>
Copyright (c) 2013-2019 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, toStringpublic LinearUnit(String nameOrNameKey, String abbreviationOrAbbreviationKey, UnitSystem unitSystem, boolean standardUnit)
nameOrNameKey - String; if standardUnit: the key to the locale file for the long name of the unit, otherwise the
name itselfabbreviationOrAbbreviationKey - String; if standardUnit: the key to the locale file for the abbreviation of the
unit, otherwise the abbreviation itselfunitSystem - UnitSystem; the unit system, e.g. SI or ImperialstandardUnit - boolean; 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 - String; if standardUnit: the key to the locale file for the long name of the unit, otherwise the
name itselfabbreviationOrAbbreviationKey - String; if standardUnit: the key to the locale file for the abbreviation of the
unit, otherwise the abbreviation itselfunitSystem - UnitSystem; the unit system, e.g. SI or ImperialreferenceUnit - U; the unit to convert toscaleFactorToReferenceUnit - double; multiply a value in this unit by the factor to convert to the given reference
unitstandardUnit - boolean; 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 - String; if standardUnit: the key to the locale file for the long name of the unit, otherwise the
name itselfabbreviationOrAbbreviationKey - String; if standardUnit: the key to the locale file for the abbreviation of the
unit, otherwise the abbreviation itselfunitSystem - UnitSystem; the unit system, e.g. SI or Imperialscale - Scale; the conversion scale to use for this unitstandardUnit - boolean; 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 - Object; the object to compare withCopyright © 2015–2019 Delft University of Technology. All rights reserved.