Package username

Class Deduction

java.lang.Object
username.Deduction
All Implemented Interfaces:
Comparable<Deduction>

public class Deduction extends Object implements Comparable<Deduction>
Represents a Deduction item that has a type and amount.
  • Constructor Details

    • Deduction

      public Deduction(String type, double amount)
      Creates a Deduction item that has a type and amount
      Parameters:
      type - Type of the deduction
      amount - Amount of the deduction
  • Method Details

    • getAmount

      public double getAmount()
    • getType

      public String getType()
    • compareTo

      public int compareTo(Deduction that)
      Compares two Deduction objects based on their amount.
      Specified by:
      compareTo in interface Comparable<Deduction>
      Parameters:
      that - the object to be compared.
      Returns:
      Positive value, zero, or a negative value if the amount for this Deduction is greater than, equal to, or less than the amount of the passed in Deduction that.