Package org.freeplane.api

# Class Quantity<U extends Enum<U> & PhysicalUnit>

java.lang.Object
org.freeplane.api.Quantity<U>

public class Quantity<U extends Enum<U> & PhysicalUnit> extends Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final U`
  `unit`
  `final double`
  `value`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Quantity(double value, U unit)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Quantity<U>`
  `add(double value, U unit)`
  `Quantity<U>`
  `add(Quantity<U> second)`
  `void`
  `assertNonNegative()`
  `static <U extends Enum<U> & PhysicalUnit>
  void`
  `assertNonNegativeOrNull(Quantity<U> quantity)`
  `boolean`
  `equals(Object obj)`
  `static <U extends Enum<U> & PhysicalUnit>
  Quantity<U>`
  `fromString(String valueString, U defaultUnit)`
  `int`
  `hashCode()`
  `Quantity<U>`
  `in(U unit)`
  `double`
  `toBaseUnits()`
  `int`
  `toBaseUnitsRounded()`
  `String`
  `toString()`
  `Quantity<U>`
  `zoomBy(double zoom)`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### value

    public final double value

  - ### unit

    public final U extends Enum<U> & PhysicalUnit unit

- ## Constructor Details

  - ### Quantity

    public Quantity(double value, U unit)

- ## Method Details

  - ### fromString

    public static <U extends Enum<U> & PhysicalUnit> Quantity<U> fromString(String valueString, U defaultUnit)

  - ### toBaseUnits

    public double toBaseUnits()

  - ### toBaseUnitsRounded

    public int toBaseUnitsRounded()

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### in

    public Quantity<U> in(U unit)

  - ### assertNonNegative

    public void assertNonNegative()

  - ### assertNonNegativeOrNull

    public static <U extends Enum<U> & PhysicalUnit> void assertNonNegativeOrNull(Quantity<U> quantity)

  - ### add

    public Quantity<U> add(Quantity<U> second)

  - ### add

    public Quantity<U> add(double value, U unit)

  - ### zoomBy

    public Quantity<U> zoomBy(double zoom)