com.io7m.jpra.model.types

## Class Size<U extends SizeUnitType>

- java.lang.Object
- - com.io7m.jpra.model.types.Size<U>

- Type Parameters:
    `U` - The unit of measurement

      @Immutable
      public final class Size<U extends SizeUnitType>
      extends Object

  A size value.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Size(BigInteger in_value)` Construct a size value.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Size<U>` | `add(Size<U> size)`
    `boolean` | `equals(Object o)`
    `BigInteger` | `getValue()`
    `int` | `hashCode()`
    `static Size<SizeUnitBitsType>` | `toBits(Size<SizeUnitOctetsType> size)`
    `String` | `toString()`
    `static <U extends SizeUnitType> Size<U>` | `valueOf(long x)` Construct a size value of `x` units.
    `static <U extends SizeUnitType> Size<U>` | `zero()`

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

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

- - ### Constructor Detail

    - #### Size

          public Size(BigInteger in_value)

      Construct a size value.
      Parameters:
        `in_value` - The size

  - ### Method Detail

    - #### zero

          public static <U extends SizeUnitType> Size<U> zero()

      Type Parameters:
        `U` - The unit of measurement
      Returns:
        The zero value

    - #### toBits

          public static Size<SizeUnitBitsType> toBits(Size<SizeUnitOctetsType> size)

      Parameters:
        `size` - A size value in octets
      Returns:
        The original size value converted to bits

    - #### valueOf

          public static <U extends SizeUnitType> Size<U> valueOf(long x)

      Construct a size value of `x` units.
      Type Parameters:
        `U` - The precise unit type
      Parameters:
        `x` - The size value
      Returns:
        A new size value

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getValue

          public BigInteger getValue()

      Returns:
        The raw numeric value

    - #### add

          public Size<U> add(Size<U> size)

      Parameters:
        `size` - A size value
      Returns:
        The current value plus `size`

Copyright © 2015 <code@io7m.com> http://io7m.com