Package net.sourceforge.processdash.data

Examples of net.sourceforge.processdash.data.ListData


                insertPos = pos+1;
            }
        }

        // Now that we have constructed the list, save it to the repository.
        ListData l = new ListData();
        for (String id : newChartIds)
            l.add(id);
        data.putValue(SETTINGS_PREFIX + taskListID + CHART_ORDERING_SETTING, l);
    }
View Full Code Here


        DataRepository data;
        DeferredLabelLookup(DataRepository data) {
            this.data = data;
        }
        public List getTaggedData(String dataName) {
            ListData result = ListData.asListData(data.getSimpleValue(dataName));
            return (result == null ? null : result.asList());
        }
View Full Code Here

    protected Object getResult(Set intersection) {
        if (intersection == null || intersection.isEmpty())
            return ListData.EMPTY_LIST;
       
        ListData result = new ListData();
        for (Iterator i = intersection.iterator(); i.hasNext();)
            result.add(i.next());
        return result;
    }
View Full Code Here

        }

        Object [] pairArray = pairs.toArray();
        Arrays.sort(pairArray);

        ListData result = new ListData();
        for (int j = 0;   j < pairArray.length;   j++)
            result.add(((Pair) pairArray[j]).prefix);
        result.setImmutable();

        return result;
    }
View Full Code Here

        return scrambleTaggedData(value, MILESTONE_PREFIX);
    }

    private String scrambleTaggedData(String value, String tag) {
        List<String> labelData = StringData.create(value).asList().asList();
        ListData newVal = new ListData();
        for (String elem : labelData) {
            if (elem.startsWith(tag)) {
                String label = elem.substring(tag.length());
                elem = tag + labelMapper.getString(label);
            }
            newVal.add(elem);
        }
        return newVal.saveString().substring(1);
    }
View Full Code Here

        // get the name of the data element we are calculating for
        String listenerName = asStringVal(context
            .get(SubscribingExpressionContext.LISTENERVAR_NAME));

        // get the database keys of the projects in question
        ListData projectKeyList = asList(getArg(arguments, 0));
        if (projectKeyList == null)
            return null;
        List<Integer> projectKeys = new ArrayList();
        for (int i = 0; i < projectKeyList.size();  i++) {
            Object oneKeyVal = projectKeyList.get(i);
            if (oneKeyVal instanceof NumberData) {
                int oneKey = ((NumberData) oneKeyVal).getInteger();
                projectKeys.add(oneKey);   
            }
        }
View Full Code Here

        Iterator i = arguments.iterator();

        Set intersection;

        ListData firstItem = asList((SimpleData) i.next());
        if (firstItem == null)
            intersection = Collections.EMPTY_SET;
        else
            intersection = new HashSet(firstItem.asList());

        while (!intersection.isEmpty() && i.hasNext()) {
            ListData nextItem = asList((SimpleData) i.next());
            if (nextItem == null)
                intersection = Collections.EMPTY_SET;
            else
                intersection.retainAll(nextItem.asList());
        }

        return getResult(intersection);
    }
View Full Code Here

            prefix = context.get(ExpressionContext.PREFIXVAR_NAME).format();

        if (prefix == null) return null;
       
        try {
            ListData hierItem = (ListData) context
                    .get(DashHierarchy.DATA_REPOSITORY_NAME);
            DashHierarchy hier = (DashHierarchy) hierItem.get(0);
           
            PropertyKey key = hier.findExistingKey(prefix);
            if (key == null) return null;
           
            ListData result = new ListData();
            collect(result, hier, key);
            return result;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
View Full Code Here

            this.key = key;
            this.initialVal = 1;
            if (metadata != null)
                this.strings = ListData.asListData(metadata.getValue(key));
            if (this.strings == null)
                this.strings = new ListData();
           
            this.cache = new HashMap<String, Integer>();
            for (int i = 0;  i < strings.size();  i++)
                cache.put((String) strings.get(i), i + initialVal);
            this.dirty = false;
View Full Code Here

        try {
            ProjectLocator loc = getDbObject(context, ProjectLocator.class);
            if (loc == null)
                return null;

            ListData result = new ListData();
            for (Iterator i = projectIDs.iterator(); i.hasNext();) {
                Integer key = null;

                String oneProjectId = asStringVal(i.next());
                if (oneProjectId != null)
                    key = loc.getKeyForProject(oneProjectId, listenerName);

                if (key == null)
                    key = -999;
                result.add(new ImmutableDoubleData(key, false, true));
            }
            return result;

        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

TOP

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

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.