Package bpntojava.model.bpndata

Examples of bpntojava.model.bpndata.DataLine


                tmpdata = datesdata.get(i);
            }
        }

        for (int i = 0; i < tmpdata.size(); i++) {
            DataLine dataline = tmpdata.get(i);
            if (dataline.get(1).equals(staff)
                    && article.startsWith(dataline.get(2))
                    && dataline.get(0).equals(date)) {
                ret += Float.parseFloat(dataline.get(4));
            }
        }
        return ret;
    }
View Full Code Here


     */
    private float getADDATA(String date, String staff) {
        float ret = (float) 0;
        if (staff.equals("Marc Schüßler")) {
            for (int i = 0; i < ad.size(); i++) {
                DataLine dataline = ad.get(i);
                if (dataline.get(0).equals(date) && dataline.get(1).equals("10044001")) {
                    ret += Float.parseFloat(dataline.get(3));
                }
            }
        }
        if (staff.equals("Gregor Rabczuk")) {
            for (int i = 0; i < ad.size(); i++) {
                DataLine dataline = ad.get(i);
                if (dataline.get(0).equals(date) && dataline.get(1).equals("10044002")) {
                    ret += Float.parseFloat(dataline.get(3));
                }
            }
        }
        if (staff.equals("Stefan Baumgartner")) {
            for (int i = 0; i < ad.size(); i++) {
                DataLine dataline = ad.get(i);
                if (dataline.get(0).equals(date) && dataline.get(1).equals("10044003")) {
                    ret += Float.parseFloat(dataline.get(3));
                }
            }
        }
        if (staff.equals("Dominik Hipper")) {
            for (int i = 0; i < ad.size(); i++) {
                DataLine dataline = ad.get(i);
                if (dataline.get(0).equals(date) && dataline.get(1).equals("10044004")) {
                    ret += Float.parseFloat(dataline.get(3));
                }
            }
        }
        if (staff.equals("Steven Frerking")) {
            for (int i = 0; i < ad.size(); i++) {
                DataLine dataline = ad.get(i);
                if (dataline.get(0).equals(date) && dataline.get(1).equals("10044005")) {
                    ret += Float.parseFloat(dataline.get(3));
                }
            }
        }
        if (staff.equals("Philipp Brinkoff")) {
            for (int i = 0; i < ad.size(); i++) {
                DataLine dataline = ad.get(i);
                if (dataline.get(0).equals(date) && dataline.get(1).equals("10044006")) {
                    ret += Float.parseFloat(dataline.get(3));
                }
            }
        }
        if (staff.equals("Kevin Schmengler")) {
            for (int i = 0; i < ad.size(); i++) {
                DataLine dataline = ad.get(i);
                if (dataline.get(0).equals(date) && dataline.get(1).equals("10044007")) {
                    ret += Float.parseFloat(dataline.get(3));
                }
            }
        }
        if (staff.equals("Julian Görres")) {
            for (int i = 0; i < ad.size(); i++) {
                DataLine dataline = ad.get(i);
                if (dataline.get(0).equals(date) && dataline.get(1).equals("10044008")) {
                    ret += Float.parseFloat(dataline.get(3));
                }
            }
        }
        if (staff.equals("Oliver Passler")) {
            for (int i = 0; i < ad.size(); i++) {
                DataLine dataline = ad.get(i);
                if (dataline.get(0).equals(date) && dataline.get(1).equals("10044009")) {
                    ret += Float.parseFloat(dataline.get(3));
                }
            }
        }
        if (staff.equals("Florian Schröder")) {
            for (int i = 0; i < ad.size(); i++) {
                DataLine dataline = ad.get(i);
                if (dataline.get(0).equals(date) && dataline.get(1).equals("10044010")) {
                    ret += Float.parseFloat(dataline.get(3));
                }
            }
        }
        if (staff.equals("Tarik Luca Badidi")) {
            for (int i = 0; i < ad.size(); i++) {
                DataLine dataline = ad.get(i);
                if (dataline.get(0).equals(date) && dataline.get(1).equals("10044011")) {
                    ret += Float.parseFloat(dataline.get(3));
                }
            }
        }
        if (staff.equals("Dirk Schneider")) {
            for (int i = 0; i < ad.size(); i++) {
                DataLine dataline = ad.get(i);
                if (dataline.get(0).equals(date) && dataline.get(1).equals("10044012")) {
                    ret += Float.parseFloat(dataline.get(3));
                }
            }
        }
        return ret;
    }
View Full Code Here


        //Datenzeilen erstellen
        LinkedList<DataLine> rows = new LinkedList();
        for (int i = 0; i < stafftable.getUsables().get(2).size(); i++) {
            DataLine dataline = new DataLine();
            dataline.add(stafftable.getUsables().get(2).get(i));
            for (int j = 0; j < stafftable.getUsables().get(1).size(); j++) {
                String staff = stafftable.getUsables().get(1).get(j);
                String article = stafftable.getUsables().get(2).get(i);
                String prize = String.valueOf(getData(date, staff, article));
                dataline.add(prize);
            }

            rows.add(sumDataLine(dataline));
        }

        //Datenzeile Außendienste
        DataLine ads = new DataLine();
        ads.add("Außendienste");
        for (int j = 0; j < stafftable.getUsables().get(1).size(); j++) {
            String staff = stafftable.getUsables().get(1).get(j);
            String prize = String.valueOf(getData(date, staff, "Außendienst"));
            ads.add(prize);
        }
        rows.add(sumDataLine(ads));

        //Datenzeile Spaltensumme
        DataLine sum = new DataLine();
        sum.add("Summe");
        for (int i = 1; i < colwidth; i++) {
            float flsum = 0;
            for (int j = 0; j < rows.size(); j++) {
                flsum += Float.valueOf(rows.get(j).get(i).replace(',', '.'));
            }
            sum.add(floatToString(String.valueOf(flsum)).replace('.', ','));
        }
        rows.add(sum);

        //Überschrift
        coldata[0][0] = "Artikel";
        for (int i = 0; i < stafftable.getUsables().get(1).size(); i++) {
            coldata[0][i + 1] = stafftable.getUsables().get(1).get(i);
        }
        coldata[0][coldata[0].length - 1] = "Summe";

        //Zeilen in die Tabelle schreiben
        for (int y = 1; y < coldata.length; y++) {
            DataLine toput = rows.get(y - 1);
            for (int i = 0; i < toput.size(); i++) {
                coldata[y][i] = toput.get(i);
            }
        }
        DefaultTableModel toReturn = new DefaultTableModel(coldata, colnames);
        return toReturn;
    }
View Full Code Here

     * @param dataline Datenzeile.
     * @return neue Datenzeile inkls Summe.
     */
    private DataLine sumDataLine(DataLine dataline) {
        float sum = 0;
        DataLine toReturn = new DataLine();
        toReturn.add(dataline.get(0));
        for (int i = 1; i < dataline.size(); i++) {
            sum += Float.parseFloat(dataline.get(i));
            toReturn.add(floatToString(dataline.get(i)).replace('.', ','));
        }
        toReturn.add(floatToString(String.valueOf(sum)).replace('.', ','));
        return toReturn;
    }
View Full Code Here

     *
     * @param row Spaltennummer
     */
    public void fillTable(int row) {
        for (int i = 0; i < data.size(); i++) {
            DataLine dataline = data.get(i);
            String toAdd = dataline.get(row);
            if (!isInTable(toAdd)) {
                usables.add(toAdd);
            }
        }
    }
View Full Code Here

TOP

Related Classes of bpntojava.model.bpndata.DataLine

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.