Examples of ItemStatLine


Examples of eu.flatworld.cstrader.data.ItemStatLine

                alWantedQty.add(il.getQuantity());
            }
        }
        HashMap<Item, ItemStatLine> hm = new HashMap<Item, ItemStatLine>();
        for (Item item : hmSalePrice.keySet()) {
            ItemStatLine isl = hm.get(item);
            if (isl == null) {
                isl = new ItemStatLine();
                isl.setItem(item);
                hm.put(item, isl);
            }
            ArrayList<Long> alPrice = hmSalePrice.get(item);
            ArrayList<Long> alQty = hmSaleQty.get(item);
            isl.setMeanSalePrice(PricelistsTools.mean(alPrice, alQty));
            isl.setMeanSaleQuantity(PricelistsTools.mean(alQty, null));
            isl.setSalePriceStdDev(PricelistsTools.standardDeviation(alPrice, alQty, isl.getMeanSalePrice()));
            isl.setTotalSaleQuantity(PricelistsTools.sum(alQty));
            isl.setSaleQuantityStdDev(PricelistsTools.standardDeviation(alQty, null, isl.getMeanSaleQuantity()));
        }
        for (Item item : hmWantedPrice.keySet()) {
            ItemStatLine isl = hm.get(item);
            if (isl == null) {
                isl = new ItemStatLine();
                isl.setItem(item);
                hm.put(item, isl);
            }
            ArrayList<Long> alPrice = hmWantedPrice.get(item);
            ArrayList<Long> alQty = hmWantedQty.get(item);
            isl.setMeanWantedPrice(PricelistsTools.mean(alPrice, alQty));
            isl.setMeanWantedQuantity(PricelistsTools.mean(alQty, null));
            isl.setWantedPriceStdDev(PricelistsTools.standardDeviation(alPrice, alQty, isl.getMeanWantedPrice()));
            isl.setTotalWantedQuantity(PricelistsTools.sum(alQty));
            isl.setWantedQuantityStdDev(PricelistsTools.standardDeviation(alQty, null, isl.getMeanWantedQuantity()));
        }
        hmSalePrice.clear();
        hmSaleQty.clear();
        hmWantedPrice.clear();
        hmWantedQty.clear();
View Full Code Here

Examples of eu.flatworld.cstrader.data.ItemStatLine

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        JLabel c = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        StatsTableModel model = (StatsTableModel) table.getModel();
        ItemStatLine itemStatLine = model.getItemAtRow(table.convertRowIndexToModel(row));

        if (value instanceof Number) {
            c.setText(df.format(value));
        }
        return c;
View Full Code Here

Examples of eu.flatworld.cstrader.data.ItemStatLine

        return data.size();
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        ItemStatLine i = data.get(rowIndex);
        switch (columnIndex) {
            case 0:
                return i.getItem().getName();
            case 1:
                return i.getTotalSaleQuantity();
            case 2:
                return i.getTotalWantedQuantity();
            case 3:
                return i.getTotalSaleQuantity() - i.getTotalWantedQuantity();
            case 4:
                return i.getMeanSaleQuantity();
            case 5:
                return i.getMeanWantedQuantity();
            case 6:
                return i.getSaleQuantityStdDev();
            case 7:
                return i.getWantedQuantityStdDev();
            case 8:
                return i.getMeanSalePrice();
            case 9:
                return i.getMeanWantedPrice();
            case 10:
                return i.getSalePriceStdDev();
            case 11:
                return i.getWantedPriceStdDev();
        }
        return null;
    }
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.