BrightSide Workbench Full Report + Source Code
org.turro.financials.cart.CartTaxable Class Reference
Inheritance diagram for org.turro.financials.cart.CartTaxable:
Collaboration diagram for org.turro.financials.cart.CartTaxable:

Public Member Functions

 CartTaxable (Double perCent, Double tax)
 
void add (Double taxValue, Double amount, Double taxable)
 
boolean isPerCent (Double perCent)
 
Double getTax ()
 
Double getDiscount ()
 
Double getAmount ()
 
Double getTaxable ()
 
Double getTaxAmount ()
 
Double getTotal ()
 
boolean isEmpty ()
 
int hashCode ()
 
boolean equals (Object obj)
 
int compareTo (CartTaxable o)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 27 of file CartTaxable.java.

Constructor & Destructor Documentation

◆ CartTaxable()

org.turro.financials.cart.CartTaxable.CartTaxable ( Double  perCent,
Double  tax 
)

Definition at line 31 of file CartTaxable.java.

31  {
32  this.perCent = perCent;
33  this.tax = tax;
34  taxValue = 0.0;
35  amount = 0.0;
36  taxable = 0.0;
37  }
Here is the caller graph for this function:

Member Function Documentation

◆ add()

void org.turro.financials.cart.CartTaxable.add ( Double  taxValue,
Double  amount,
Double  taxable 
)

Definition at line 39 of file CartTaxable.java.

39  {
40  this.taxValue += taxValue;
41  this.amount += amount;
42  this.taxable += taxable;
43  }
Here is the caller graph for this function:

◆ compareTo()

int org.turro.financials.cart.CartTaxable.compareTo ( CartTaxable  o)

Definition at line 103 of file CartTaxable.java.

103  {
104  return perCent.compareTo(o.perCent);
105  }

◆ equals()

boolean org.turro.financials.cart.CartTaxable.equals ( Object  obj)

Definition at line 88 of file CartTaxable.java.

88  {
89  if (obj == null) {
90  return false;
91  }
92  if (getClass() != obj.getClass()) {
93  return false;
94  }
95  final CartTaxable other = (CartTaxable) obj;
96  if (this.perCent != other.perCent && (this.perCent == null || !this.perCent.equals(other.perCent))) {
97  return false;
98  }
99  return true;
100  }
CartTaxable(Double perCent, Double tax)
Here is the call graph for this function:

◆ getAmount()

Double org.turro.financials.cart.CartTaxable.getAmount ( )

Definition at line 57 of file CartTaxable.java.

57  {
58  return amount;
59  }

◆ getDiscount()

Double org.turro.financials.cart.CartTaxable.getDiscount ( )

Definition at line 53 of file CartTaxable.java.

53  {
54  return new Round(amount - taxable).decimals(2).value();
55  }
Here is the call graph for this function:

◆ getTax()

Double org.turro.financials.cart.CartTaxable.getTax ( )

Definition at line 49 of file CartTaxable.java.

49  {
50  return tax;
51  }

◆ getTaxable()

Double org.turro.financials.cart.CartTaxable.getTaxable ( )

Definition at line 61 of file CartTaxable.java.

61  {
62  return taxable;
63  }
Here is the caller graph for this function:

◆ getTaxAmount()

Double org.turro.financials.cart.CartTaxable.getTaxAmount ( )

Definition at line 65 of file CartTaxable.java.

65  {
66  return taxValue;
67  }
Here is the caller graph for this function:

◆ getTotal()

Double org.turro.financials.cart.CartTaxable.getTotal ( )

Definition at line 69 of file CartTaxable.java.

69  {
70  if(tax == 0.0) {
71  return taxable;
72  }
73  return taxable + taxValue;
74  }
Here is the caller graph for this function:

◆ hashCode()

int org.turro.financials.cart.CartTaxable.hashCode ( )

Definition at line 81 of file CartTaxable.java.

81  {
82  int hash = 7;
83  hash = 23 * hash + (this.perCent != null ? this.perCent.hashCode() : 0);
84  return hash;
85  }

◆ isEmpty()

boolean org.turro.financials.cart.CartTaxable.isEmpty ( )

Definition at line 76 of file CartTaxable.java.

76  {
77  return amount == null || amount == 0 || amount.isNaN();
78  }

◆ isPerCent()

boolean org.turro.financials.cart.CartTaxable.isPerCent ( Double  perCent)

Definition at line 45 of file CartTaxable.java.

45  {
46  return this.perCent.equals(perCent);
47  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: