MFDecimal (3.14.0 310 API)
Date: 2018-05-30

com.marketfactory.api

## Class MFDecimal

- java.lang.Object
- - com.marketfactory.api.MFDecimal

- All Implemented Interfaces:
    java.lang.Comparable

      public class MFDecimal
      extends java.lang.Object
      implements java.lang.Comparable

  A thin immutable wrapper for a floating point number. Must be 15 digits or less.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static MFDecimal` | `NA` Special value: Not Applicable.
    `static MFDecimal` | `NDA` Special value: No Data Available.
    `static MFDecimal` | `NMA` Special value: No Market Available.
    `static MFDecimal` | `ZERO` Special value: Zero (as a convenience).

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MFDecimal(java.lang.String s)` Constructor which accepts a string value.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `MFDecimal` | `abs()`
    `int` | `compareTo(java.lang.Object o)`
    `boolean` | `equals(MFDecimal o)`
    `boolean` | `gt(MFDecimal o)`
    `boolean` | `gte(MFDecimal o)`
    `int` | `hashCode()` Forwards to raw value.
    `static boolean` | `isValid(MFDecimal o)`
    `boolean` | `lt(MFDecimal o)`
    `boolean` | `lte(MFDecimal o)`
    `MFDecimal` | `neg()`
    `double` | `toDouble()`
    `long` | `toLong()`
    `java.lang.String` | `toString()` Provide access to the raw value.
    `static MFDecimal` | `valueOf(java.math.BigDecimal num)`
    `static MFDecimal` | `valueOf(double num)`
    `static MFDecimal` | `valueOf(long num)`
    `static MFDecimal` | `valueOf(java.lang.String s)`

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

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

- - ### Field Detail

    - #### NMA

          public static MFDecimal NMA

      Special value: No Market Available.

    - #### NDA

          public static MFDecimal NDA

      Special value: No Data Available.

    - #### NA

          public static MFDecimal NA

      Special value: Not Applicable.

    - #### ZERO

          public static MFDecimal ZERO

      Special value: Zero (as a convenience).

  - ### Constructor Detail

    - #### MFDecimal

          public MFDecimal(java.lang.String s)
                    throws java.lang.NumberFormatException

      Constructor which accepts a string value.
      Parameters:
        `s` - -- the initial value
      Throws:
        `java.lang.NumberFormatException`

  - ### Method Detail

    - #### valueOf

          public static MFDecimal valueOf(java.lang.String s)
                                   throws java.lang.NumberFormatException

      Parameters:
        `s` - -- the initial value
      Returns:
        a MFDecimal object for the given representation of a FP number.
      Throws:
        `java.lang.NumberFormatException`

    - #### valueOf

          public static MFDecimal valueOf(java.math.BigDecimal num)
                                   throws java.lang.NumberFormatException

      Parameters:
        `num` - -- the initial value
      Returns:
        a MFDecimal object for the given representation of a FP number.
      Throws:
        `java.lang.NumberFormatException`

    - #### valueOf

          public static MFDecimal valueOf(double num)

      Parameters:
        `num` - -- the initial value
      Returns:
        a MFDecimal object for the given representation of a FP number.

    - #### valueOf

          public static MFDecimal valueOf(long num)

      Parameters:
        `num` - -- the initial value
      Returns:
        a MFDecimal object for the given representation of a FP number.

    - #### toLong

          public long toLong()

      Returns:
        Convert the value. Will throw UnsupportedOperationException if not valid. Will throw NumberFormatException if value is out of range.

    - #### toDouble

          public double toDouble()

      Returns:
        Convert the value. Will throw UnsupportedOperationException if not valid.

    - #### toString

          public java.lang.String toString()

      Provide access to the raw value.
      Overrides:
        `toString` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Forwards to raw value.
      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(MFDecimal o)

      Parameters:
        `o` - -- rhs
      Returns:
        Comparison operator: equal.

    - #### lte

          public boolean lte(MFDecimal o)

      Parameters:
        `o` - -- rhs
      Returns:
        Comparison operator: less-than or equal. Will throw UnsupportedOperationException if either of the objects is not valid.

    - #### gte

          public boolean gte(MFDecimal o)

      Parameters:
        `o` - -- rhs
      Returns:
        Comparison operator: greater-than or equal. Will throw UnsupportedOperationException if either of the objects is not valid.

    - #### lt

          public boolean lt(MFDecimal o)

      Parameters:
        `o` - -- rhs
      Returns:
        Comparison operator: less-than. Will throw UnsupportedOperationException if either of the objects is not valid.

    - #### gt

          public boolean gt(MFDecimal o)

      Parameters:
        `o` - -- rhs
      Returns:
        Comparison operator: greater-than. Will throw UnsupportedOperationException if either of the objects is not valid.

    - #### neg

          public MFDecimal neg()

      Returns:
        Negate value.

    - #### abs

          public MFDecimal abs()

      Returns:
        Absolute value.

    - #### compareTo

          public int compareTo(java.lang.Object o)
                        throws java.lang.ClassCastException

      Specified by:
        `compareTo` in interface `java.lang.Comparable`
      Parameters:
        `o` - -- object to check
      Returns:
        Implements Comparable method compareTo.
      Throws:
        `java.lang.ClassCastException`

    - #### isValid

          public static boolean isValid(MFDecimal o)

      Parameters:
        `o` - -- object to check
      Returns:
        Check if MFDecimal object has valid value.