Class OfficePercentage

java.lang.Object
com.github.miachm.sods.OfficePercentage

public class OfficePercentage extends Object
This class defines a percentage in a Spreadsheet
  • Constructor Details

    • OfficePercentage

      public OfficePercentage(Double value)
      Build a default object with a value
      Parameters:
      value - The percentage in a normalized value (1.0 is a 100%). It can be null
    • OfficePercentage

      public OfficePercentage(String value)
      Build a default object using the string representation of percentage
      Parameters:
      value - The percentage in a string representation (ex: "40%")
      Throws:
      IllegalArgumentException - If the string does not represent a valid percentage representation.
  • Method Details

    • getValue

      public Double getValue()
    • equals

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

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

      public String toString()
      It prints a representation of the percentage in a '%' format
      Overrides:
      toString in class Object