Package net.sourceforge.processdash.data

Examples of net.sourceforge.processdash.data.SimpleData


            return null;
        }
    }

    public boolean getTest(String dataName) {
        SimpleData sd = getSimpleValue(dataName);
        return (sd != null && sd.test());
    }
View Full Code Here


            return new GetTest();
        else if ("child".equals(key))
            return new GetChild();

        // Look up a data value, and cast it to a plain Java type
        SimpleData sd = getSimpleValue(key);
        return convert(sd);
    }
View Full Code Here

        return (valueNeeded ? result : 0);
    }

    protected double getValueAt(DataContext data, PropertyKey node) {
        String fullDataName = getDataName(node);
        SimpleData sd = data.getSimpleValue(fullDataName);
        if (sd instanceof DoubleData) {
            DoubleData dd = (DoubleData) sd;
            return dd.getDouble();
        }
        return 0;
View Full Code Here

    }

    protected boolean testTagAt(DataContext data, PropertyKey node) {
        String fullTagName = DataRepository
                .createDataName(node.path(), tagName);
        SimpleData sd = data.getSimpleValue(fullTagName);
        return sd != null && sd.test();
    }
View Full Code Here

        return results;
    }

    private static List getList(DataContext data, String prefix, String name) {
        name = DataRepository.createDataName(prefix, name);
        SimpleData phaseDataElem = data.getSimpleValue(name);
        if (phaseDataElem instanceof ListData)
            return ((ListData) phaseDataElem).asList();
        else if (phaseDataElem instanceof StringData)
            return ((StringData) phaseDataElem).asList().asList();
        return Collections.EMPTY_LIST;
View Full Code Here

    public String format(int row, int col) {
        // row and column headers are strings
        if (row == 0) return getColName(col);
        if (col == 0) return getRowName(row);

        SimpleData d = getData(row, col);
        if (d == null || !d.isDefined()) return "";

        String result = d.format();
        if (result.startsWith("#") || result.startsWith("ERR")) return result;

        int fmt = useRowFormats ? row : col;
        return prefix[fmt] + result + suffix[fmt];
    }
View Full Code Here

        return result;
    }

    private static ListData lookupList(DataRepository data, String name) {
        SimpleData result = data.getSimpleValue(name);
        if (result instanceof ListData)
            return (ListData) result;
        if (result instanceof StringData)
            return ((StringData) result).asList();
        return null;
View Full Code Here

        String what = purpose.getKey();
        String method = (String) params.get(what);
        if (method == null) return false;
        String qual = what + method;

        SimpleData estimate, range, lpi, upi;

        // Save the chosen method
        putValue(getDataName(SEL_METHOD), StringData.create(method));

        // Save the estimated value
View Full Code Here

    }

    protected SimpleData getNum(String qual, String name, double mult) {
        String inputFieldName = qual + name;
        String inputFieldValue = (String) params.get(inputFieldName);
        SimpleData result = N_A;
        try {
            double value = Double.parseDouble(inputFieldValue);
            if (!Double.isInfinite(value) && !Double.isNaN(value))
              result = new DoubleData(value * mult);
        } catch (NumberFormatException nfe) { }
View Full Code Here

    private String getDataName(String elemName) {
        return targetDataElement + "/" + elemName;
    }

    private String getSelectedMethod() {
        SimpleData val = getValue(getDataName(SEL_METHOD));
        if (val == null) return null;
        String result = val.format();
        if (result.endsWith("  ")) return null;
        return result.trim();
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.data.SimpleData

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.