Class Euro

java.lang.Object
overit.geocall.util.Euro
All Implemented Interfaces:
Serializable, Comparable

public class Euro extends Object implements Comparable, Serializable
Utility class used to manage the object Euro
See Also:
  • Field Details

    • MAX_VALUE

      public static final long MAX_VALUE
      See Also:
    • MIN_VALUE

      public static final long MIN_VALUE
      See Also:
    • _unscaledValue

      protected long _unscaledValue
    • isNull

      protected boolean isNull
    • _precision

      protected int _precision
  • Constructor Details

    • Euro

      public Euro(long unscaledValue)
      Creates a new instance of Euro
      Parameters:
      unscaledValue - Value without the scale
    • Euro

      public Euro(String strValue)
      Creates a new instance of Euro
      Parameters:
      strValue - String containing the value
    • Euro

      public Euro(String strValue, String decimalSep, String groupSep)
      Creates a new instance of Euro
      Parameters:
      strValue - String containing the value
      decimalSep - String containing the decimal separator
      groupSep - String containing the group separator
  • Method Details

    • add

      public Euro add(Euro val)
      Method used to add Euro
      Parameters:
      val - Euro to add
      Returns:
      The result of the sum
    • subtract

      public Euro subtract(Euro val)
      Method used to subtract Euro
      Parameters:
      val - Euro to subtract
      Returns:
      The result of the subtraction
    • multiply

      public Euro multiply(int mult)
      Method used to multiply Euro
      Parameters:
      mult - Euro to multiply
      Returns:
      The result of the moltiplication
    • multiply

      public Euro multiply(double mult)
      Method used to multiply Euro
      Parameters:
      mult - Euro to multiply
      Returns:
      The result of the moltiplication
    • divide

      public Euro divide(int div)
      Method used to divide Euro
      Parameters:
      div - Euro to divide
      Returns:
      The result of the division
    • divide

      public Euro divide(double div)
      Method used to divide Euro
      Parameters:
      div - Euro to divide
      Returns:
      The result of the division
    • divide

      public double divide(Euro div)
      Method used to divide Euro
      Parameters:
      div - Euro to divide
      Returns:
      The result of the division
    • percent

      public Euro percent(double percent)
      Method used to get the percent of an Euro
      Parameters:
      percent - The percent value
      Returns:
      The result of the percent
    • equals

      public boolean equals(Object val)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isGreaterThan

      public boolean isGreaterThan(Euro val)
      Method used to know if an Euro is grater than another
      Parameters:
      val - Euro to consider
      Returns:
      true if is greater, false otherwise
    • isGreaterOrEqualThan

      public boolean isGreaterOrEqualThan(Euro val)
      Method used to know if an Euro is grater or equal than another
      Parameters:
      val - Euro to consider
      Returns:
      true if is greater or equal, false otherwise
    • isSmallerThan

      public boolean isSmallerThan(Euro val)
      Method used to know if an Euro is smaller than another
      Parameters:
      val - Euro to consider
      Returns:
      true if is smaller, false otherwise
    • isSmallerOrEqualThan

      public boolean isSmallerOrEqualThan(Euro val)
      Method used to know if an Euro is smaller or equal than another
      Parameters:
      val - Euro to consider
      Returns:
      true if is smaller or equal, false otherwise
    • setPrecision

      public void setPrecision(int p)
      Sets the precision
      Parameters:
      p - The precision
    • toInputString

      public String toInputString()
      Returns:
      see getString() with "." as delimiter
    • toString

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

      public String toString(String decimalSep, String groupSep)
      Returns the string representation of Euro
      Parameters:
      decimalSep - String representing the decimal separator
      groupSep - String representing the group separator
      Returns:
      The string representation of Euro
    • getUnscaledValue

      public Long getUnscaledValue()
      Returns the unscaled value
      Returns:
      The unscaled value
    • compareTo

      public int compareTo(Object obj)
      Specified by:
      compareTo in interface Comparable
    • doubleValue

      public double doubleValue()
      Returns the Euro as double
      Returns:
      The Euro as double
    • main

      public static void main(String[] args)