Package org.archfirst.common.quantity

Examples of org.archfirst.common.quantity.DecimalQuantity.plus()


   
    @Transient
    public DecimalQuantity getCumQtyOfExecutions() {
        DecimalQuantity total = new DecimalQuantity();
        for (Execution execution : executions) {
            total = total.plus(execution.getQuantity());
        }
        return total;
    }
   
    @Transient
View Full Code Here


        Money totalPrice = new Money("0.00");
        DecimalQuantity totalQuantity = new DecimalQuantity();
        for (Execution execution : executions) {
            totalPrice = totalPrice.plus(
                    execution.getPrice().times(execution.getQuantity()));
            totalQuantity = totalQuantity.plus(execution.getQuantity());
        }
        totalPrice = totalPrice.scaleToCurrency();
        return totalPrice.div(totalQuantity, Constants.PRICE_SCALE);
    }
   
View Full Code Here

       
        DecimalQuantity numberOfShares = DecimalQuantity.ZERO;
       
        List<Lot> lots = findActiveLots(account, symbol);
        for (Lot lot : lots) {
            numberOfShares = numberOfShares.plus(lot.getQuantity());
        }

        return numberOfShares;
    }
View Full Code Here

   
    @Transient
    public DecimalQuantity getCumQty() {
        DecimalQuantity cumQty = new DecimalQuantity();
        for (Execution execution : executions) {
            cumQty = cumQty.plus(execution.getQuantity());
        }
        return cumQty;
    }
   
    @Transient
View Full Code Here

        Money totalPrice = new Money("0.00");
        DecimalQuantity totalQuantity = new DecimalQuantity();
        for (Execution execution : executions) {
            totalPrice = totalPrice.plus(
                    execution.getPrice().times(execution.getQuantity()));
            totalQuantity = totalQuantity.plus(execution.getQuantity());
        }
        totalPrice = totalPrice.scaleToCurrency();
        return totalPrice.div(totalQuantity, Constants.PRICE_SCALE);
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.