Package mgui.numbers

Interface MguiNumber

All Superinterfaces:
java.lang.Cloneable, java.lang.Comparable<MguiNumber>, XMLObject
All Known Implementing Classes:
MguiBoolean, MguiDouble, MguiFloat, MguiInteger, MguiLong, MguiShort

public interface MguiNumber
extends java.lang.Cloneable, java.lang.Comparable<MguiNumber>, XMLObject
Interface for numbers used in ModelGUI. In contrast to native Java number wrapper classes, instances of MguiNumber are modifiable; thus must be used with caution due to synchronicity issues, etc. This interface also specifies methods for basic arithmetic and comparisons.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Method Details

    • toString

      java.lang.String toString​(java.lang.String pattern)
      Returns the value of this number as a String, formatted with pattern.
      Parameters:
      pattern -
      Returns:
    • clone

      java.lang.Object clone()
    • setValue

      boolean setValue​(java.lang.String val)
    • setValue

      void setValue​(MguiNumber val)
    • setValue

      void setValue​(double val)
    • compareTo

      int compareTo​(double d)
    • compareTo

      int compareTo​(double d, int precision)
    • getByteSize

      int getByteSize()
    • getValue

      double getValue()
      Returns the value of this number
      Returns:
    • add

      Update the value of this number by adding n.
      Parameters:
      n -
      Returns:
      this number
    • subtract

      MguiNumber subtract​(MguiNumber n)
      Update the value of this number by subtracting n.
      Parameters:
      n -
      Returns:
      this number
    • multiply

      MguiNumber multiply​(MguiNumber n)
      Update the value of this number by multiplying by n.
      Parameters:
      n -
      Returns:
      this number
    • divide

      MguiNumber divide​(MguiNumber n)
      Update the value of this number by dividing by n.
      Parameters:
      n -
      Returns:
      this number
    • add

      MguiNumber add​(double n)
      Update the value of this number by adding n.
      Parameters:
      n -
      Returns:
      this number
    • subtract

      MguiNumber subtract​(double n)
      Update the value of this number by subtracting n.
      Parameters:
      n -
      Returns:
      this number
    • multiply

      MguiNumber multiply​(double n)
      Update the value of this number by multiplying by n.
      Parameters:
      n -
      Returns:
      this number
    • divide

      MguiNumber divide​(double n)
      Update the value of this number by dividing by n.
      Parameters:
      n -
      Returns:
      this number