AnyLogic
Expand
Font size
All Implemented Interfaces:
IUnits<LengthUnits>, Serializable, Comparable<LengthUnits>, Constable

public enum LengthUnits
extends Enum<LengthUnits>
implements IUnits<LengthUnits>
Standard AnyLogic length units, should be used in specific functions and parameters which work with units.
Author:
AnyLogic North America, LLC https://anylogic.com

Nested Class Summary

Nested classes/interfaces inherited from class java.lang.Enum

Enum.EnumDesc<E extends Enum<E>>

Field Summary

Fields inherited from interface com.anylogic.engine.IUnits

ALL_UNIT_TYPES

Method Summary

Modifier and TypeMethodDescription
doubleconvertTo(double value, LengthUnits units)
Converts the given value from this units to the given units
StringformatName(boolean fullName) 
StringgetName()
Returns human-readable name (e.g.
doublemodifier(LengthUnits units) 
static LengthUnitsvalueOf(String name)
Returns the enum constant of this class with the specified name.
static LengthUnits[]values()
Returns an array containing the constants of this enum class, in the order they are declared.

Methods inherited from class java.lang.Enum

compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Methods inherited from interface com.anylogic.engine.IUnits

name

Method Details

values

public static LengthUnits[] values()
Returns an array containing the constants of this enum class, in the order they are declared.
Returns:
an array containing the constants of this enum class, in the order they are declared

valueOf

public static LengthUnits valueOf(String name)
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum class has no constant with the specified name
NullPointerException - if the argument is null

formatName

public String formatName(boolean fullName)

getName

public String getName()
Description copied from interface: IUnits
Returns human-readable name (e.g. "meters per second")
Specified by:
getName in interface IUnits<LengthUnits>

modifier

public double modifier(LengthUnits units)
Specified by:
modifier in interface IUnits<LengthUnits>

convertTo

public double convertTo(double value,
 LengthUnits units)
Description copied from interface: IUnits
Converts the given value from this units to the given units
Specified by:
convertTo in interface IUnits<LengthUnits>
Parameters:
value - the value, measured in this units
units - units to convert the value to
Returns:
the value, measured in the given units