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

Public Member Functions

 Amount (Double tax, Double subtotal, Double discount, Double retained, int fractionDigits)
 
void setAmountSet (AmountSet amountSet)
 
boolean isEmpty ()
 
void addTax (Double tax, Double subtotal, Double discount, Double retained)
 
Double getTax ()
 
Double getRetained ()
 
Double getDiscount ()
 
Double getSubtotal ()
 
Double getTaxable ()
 
Double getTaxValue ()
 
Double getAmount ()
 
boolean equals (Object obj)
 
int hashCode ()
 
int compareTo (Amount o)
 

Detailed Description

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

Definition at line 26 of file Amount.java.

Constructor & Destructor Documentation

◆ Amount()

org.turro.financials.model.Amount.Amount ( Double  tax,
Double  subtotal,
Double  discount,
Double  retained,
int  fractionDigits 
)

Definition at line 32 of file Amount.java.

32  {
33  this.tax = tax;
34  this.subtotal = subtotal;
35  this.discount = discount;
36  this.retained = retained;
37  this.fractionDigits = fractionDigits;
38  }
Here is the caller graph for this function:

Member Function Documentation

◆ addTax()

void org.turro.financials.model.Amount.addTax ( Double  tax,
Double  subtotal,
Double  discount,
Double  retained 
)

Definition at line 48 of file Amount.java.

48  {
49  this.tax = tax;
50  this.subtotal += subtotal;
51  this.discount += discount;
52  this.retained += retained;
53  }
Here is the caller graph for this function:

◆ compareTo()

int org.turro.financials.model.Amount.compareTo ( Amount  o)

Definition at line 110 of file Amount.java.

110  {
111  return tax.compareTo(o.getTax());
112  }
Here is the call graph for this function:

◆ equals()

boolean org.turro.financials.model.Amount.equals ( Object  obj)

Definition at line 88 of file Amount.java.

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

◆ getAmount()

Double org.turro.financials.model.Amount.getAmount ( )

Definition at line 79 of file Amount.java.

79  {
80 // if(amountSet.getOperatingModifier().isSumTax()) {
81  return new Round((getTaxable() * (1.0 + tax / 100.0))).decimals(fractionDigits).value() - retained;
82 // } else {
83 // return new Round(getTaxable() - retained).decimals(fractionDigits).value();
84 // }
85  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDiscount()

Double org.turro.financials.model.Amount.getDiscount ( )

Definition at line 63 of file Amount.java.

63  {
64  return discount;
65  }
Here is the caller graph for this function:

◆ getRetained()

Double org.turro.financials.model.Amount.getRetained ( )

Definition at line 59 of file Amount.java.

59  {
60  return retained;
61  }
Here is the caller graph for this function:

◆ getSubtotal()

Double org.turro.financials.model.Amount.getSubtotal ( )

Definition at line 67 of file Amount.java.

67  {
68  return subtotal;
69  }
Here is the caller graph for this function:

◆ getTax()

Double org.turro.financials.model.Amount.getTax ( )

Definition at line 55 of file Amount.java.

55  {
56  return tax;
57  }
Here is the caller graph for this function:

◆ getTaxable()

Double org.turro.financials.model.Amount.getTaxable ( )

Definition at line 71 of file Amount.java.

71  {
72  return new Round(subtotal - discount).decimals(fractionDigits).value();
73  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTaxValue()

Double org.turro.financials.model.Amount.getTaxValue ( )

Definition at line 75 of file Amount.java.

75  {
76  return (getAmount() + retained) - getTaxable();
77  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hashCode()

int org.turro.financials.model.Amount.hashCode ( )

Definition at line 103 of file Amount.java.

103  {
104  int hash = 3;
105  hash = 97 * hash + (this.tax != null ? this.tax.hashCode() : 0);
106  return hash;
107  }

◆ isEmpty()

boolean org.turro.financials.model.Amount.isEmpty ( )

Definition at line 44 of file Amount.java.

44  {
45  return subtotal == null || subtotal == 0 || subtotal.isNaN();
46  }

◆ setAmountSet()

void org.turro.financials.model.Amount.setAmountSet ( AmountSet  amountSet)

Definition at line 40 of file Amount.java.

40  {
41  this.amountSet = amountSet;
42  }
Here is the caller graph for this function:

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