Package name.abuchen.portfolio.snapshot

Examples of name.abuchen.portfolio.snapshot.SecurityPosition


        {
            Assignment assignment = node.getAssignment();
            if (assignment.getInvestmentVehicle() instanceof Security)
            {
                PortfolioSnapshot portfolio = snapshot.getJointPortfolio();
                SecurityPosition p = portfolio.getPositionsBySecurity().get(assignment.getInvestmentVehicle());
                if (p != null)
                    actual += Math.round(p.calculateValue() * assignment.getWeight()
                                    / (double) Classification.ONE_HUNDRED_PERCENT);
            }
            else if (assignment.getInvestmentVehicle() instanceof Account)
            {
                for (AccountSnapshot s : snapshot.getAccounts())
View Full Code Here


    }

    private void addAction(IMenuManager manager, PortfolioSnapshot portfolio, final String label)
    {
        Model model = (Model) getModel();
        final SecurityPosition position = portfolio.getPositionsBySecurity().get(model.getSecurity());
        if (position != null)
        {
            Action action = new Action(MessageFormat.format(Messages.DividendsDialogLabelPortfolioSharesHeld,
                            Values.Share.format(position.getShares()), label, portfolio.getTime()))
            {
                @Override
                public void run()
                {
                    ((Model) getModel()).setShares(position.getShares());
                }
            };
            manager.add(action);
        }
    }
View Full Code Here

                return;

            if (snapshot == null || !snapshot.getTime().equals(date))
                snapshot = ClientSnapshot.create(getClient(), date);

            SecurityPosition p = snapshot.getJointPortfolio().getPositionsBySecurity().get(security);

            long newValue = p != null ? p.getShares() : 0;
            firePropertyChange("shares", this.shares, this.shares = newValue); //$NON-NLS-1$
        }
View Full Code Here

            if (type == PortfolioTransaction.Type.SELL && security != null)
            {
                ClientSnapshot snapshot = ClientSnapshot.create(client, Dates.today());
                for (PortfolioSnapshot p : snapshot.getPortfolios())
                {
                    SecurityPosition position = p.getPositionsBySecurity().get(security);
                    if (position != null && (portfolio == null || p.getSource().equals(portfolio)))
                    {
                        setShares(position.getShares());
                        setPortfolio(p.getSource());
                        setTotal(position.calculateValue());
                        break;
                    }
                }
            }
            else
View Full Code Here

TOP

Related Classes of name.abuchen.portfolio.snapshot.SecurityPosition

Copyright © 2018 www.massapicom. 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.