18 package org.turro.financials.model.document;
20 import org.turro.financials.entity.Document;
21 import org.turro.math.Zero;
22 import org.turro.util.CompareUtil;
31 private double docAmount, expAmount;
34 this.document = document;
35 this.expAmount = expAmount;
44 return docAmount - expAmount;
49 return CompareUtil.compare(document.
getId(), o.
getId());
53 expAmount += descendantAmount;
56 boolean fullfillsWith(
double descendantAmount) {
57 return Zero.
near(docAmount - (expAmount + descendantAmount), 2);
60 boolean fullfillsBackwardWith(
double ancestorAmount) {
61 docAmount = ancestorAmount;
62 return Zero.near(ancestorAmount - expAmount, 2);
PortfolioDisagreement(Document document, double expAmount)
void addAmount(double descendantAmount)
int compareTo(Document o)
static boolean near(double value, int digits)