Package net.sourceforge.processdash.data

Examples of net.sourceforge.processdash.data.SimpleData


    protected String getValue(String name) {
        DataRepository data = getDataRepository();
        String prefix = getPrefix();
        if (prefix == null) prefix = "";
        String dataName = DataRepository.createDataName(prefix, name);
        SimpleData d = data.getSimpleValue(dataName);
        return (d == null ? null : d.format());
    }
View Full Code Here


        // if the node has children, logging time here is not allowed, unless
        // the node explicitly defines a "Time_Logging_Allowed" marker.
        if (props.pget(node).getNumChildren() > 0) {
            String dataName = DataRepository.createDataName(node.path(),
                    "Time_Logging_Allowed");
            SimpleData marker = data.getSimpleValue(dataName);
            return (marker != null && marker.test());
        }

        // check to see if the current node defines time as a calculation.
        // if it does, logging time here is not allowed.
        String dataName = DataRepository.createDataName(node.path(), "Time");
View Full Code Here

    }

    private void processMaxDate(ExportedDataValue v) {
        String name = v.getName();
        if (name.endsWith("/Started") || name.endsWith("/Completed")) {
            SimpleData value = v.getSimpleValue();
            if (value instanceof DateData) {
                Date thisDate = ((DateData) value).getValue();
                maxDate = DateUtils.maxDate(maxDate, thisDate);
            }
        }
View Full Code Here

        PROCESS_AUTO_DATA_PATTERN = Pattern.compile(pat.substring(1));
    }

    private boolean isSkippableDoubleData(ExportedDataValue v) {
        if (skipZero || skipInfNaN) {
            SimpleData value = v.getSimpleValue();
            if (value instanceof DoubleData) {
                double d = ((DoubleData) value).getDouble();
                return ((skipZero && d == 0) || (skipInfNaN && (Double.isNaN(d) || Double
                        .isInfinite(d))));
            }
View Full Code Here

            for (Iterator i = names.entrySet().iterator(); i.hasNext();) {
                Map.Entry e = (Map.Entry) i.next();
                String tagName = (String) e.getKey();
                if (StringUtils.hasValue(tagName)) {
                    String dataName = prefix + tagName;
                    SimpleData sd = data.getSimpleValue(dataName);
                    if (sd == null || sd.test() == false)
                        continue;
                }
                result.addAll((Set) e.getValue());
            }
            return result.iterator();
View Full Code Here

    private HashTree sortDataElements(Iterator dataElements) {
        HashTree result = new HashTree(TreeMap.class);
        while (dataElements.hasNext()) {
            ExportedDataValue v = (ExportedDataValue) dataElements.next();
            String name = v.getName();
            SimpleData simpleValue = v.getSimpleValue();
            if (simpleValue != null)
                result.put(name, simpleValue);
        }
        return result;
    }
View Full Code Here

            int depth) throws IOException {
        // write all the tags for this node first.
        for (Iterator iter = data.getContents(); iter.hasNext();) {
            Map.Entry e = (Map.Entry) iter.next();
            String dataName = (String) e.getKey();
            SimpleData dataValue = (SimpleData) e.getValue();
            if (dataValue instanceof TagData)
                writeDataElement(xml, dataName, dataValue, depth);
        }

        // now, write the rest of the data elements.
        for (Iterator iter = data.getContents(); iter.hasNext();) {
            Map.Entry e = (Map.Entry) iter.next();
            String dataName = (String) e.getKey();
            SimpleData dataValue = (SimpleData) e.getValue();
            if (!(dataValue instanceof TagData))
                writeDataElement(xml, dataName, dataValue, depth);
        }

        // finally, write all the children.
View Full Code Here

                XmlSerializer xml, String tagName) throws IOException {
            writeTag(xml, tagName, getValue(data, row, col, pos));
        }

        protected String getValue(ResultSet data, int row, int col, int pos) {
            SimpleData sd = null;
            if (row > 0 && col > 0)
                sd = data.getData(row, col);

            double result;
            if (sd instanceof DoubleData) {
View Full Code Here

        String result = null;

        // check to see if any pending invitations are currently stored.
        for (int i = MAX_OUTSTANDING_INVITES; i-- > 0;) {
            String dataName = DATA_PREFIX + i + DATA_SUFFIX;
            SimpleData preexistingInvitation = ctx.getData().getSimpleValue(
                dataName);

            if (preexistingInvitation == null) {
                // if there is no invitation with this data name, we can
                // store our new invitation here.
                result = dataName;

            } else {
                // if we found a preexisting invitation, check to see if it
                // is for the same project as the newly received invitation.
                // If so, write the new invitation to this data element,
                // overwriting the old invitation.
                try {
                    String preexistingProjectID = XMLUtils
                            .parse(preexistingInvitation.format())
                            .getDocumentElement().getAttribute(PROJECT_ID);
                    if (projectID.equals(preexistingProjectID))
                        return dataName;

                } catch (Exception e) {
View Full Code Here

    public static void notifyUserOfPendingInvitations(DashboardContext ctx) {
        for (int i = MAX_OUTSTANDING_INVITES; i-- > 0;) {
            String dataPrefix = DATA_PREFIX + i;
            String dataName = dataPrefix + DATA_SUFFIX;
            SimpleData sd = ctx.getData().getSimpleValue(dataName);
            if (sd != null) {
                try {
                    handlePendingInvitation(ctx, dataPrefix, sd.format());
                } catch (Exception e) {
                    ctx.getData().putValue(dataName, null);
                    if (!(e instanceof AlreadyJoinedException))
                        e.printStackTrace();
                }
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.