Package pspdash.data

Examples of pspdash.data.SimpleData


     */
    protected void loadID(String taskListName) {
        String globalPrefix = MAIN_DATA_PREFIX + taskListName;
        String dataName = data.createDataName(globalPrefix, ID_DATA_NAME);

        SimpleData d = data.getSimpleValue(dataName);
        if (d != null) {
            taskListID = d.format();
        } else {
            // This task list doesn't have a unique ID yet.  Generate one.
            // It should be a value that needs no special handling to
            // appear as an XML attribute.
            int i = Math.abs((new Random()).nextInt());
View Full Code Here


    /** Write the CGI header. */
    protected void writeHeader() {
        DataRepository data = getDataRepository();
        String prefix = getPrefix();
        String dataName = DataRepository.createDataName(prefix, DATA_NAME);
        SimpleData d = data.getSimpleValue(dataName);
        String subsetPrefix = null;
        if (d != null) subsetPrefix = d.format();
        if (subsetPrefix == null || subsetPrefix.length() == 0)
            subsetPrefix = DEFAULT_PREFIX;

        out.print("Location: ");
        out.print(TinyWebServer.urlEncodePath(subsetPrefix));
View Full Code Here

     *
     * This method <b>must</b> be thread-safe.
     */
    public Object call(List arguments, ExpressionContext context)
    {
        SimpleData arg;

        for (int i = 0;   i < arguments.size();   i++)
            if (!isBadValue(arg = getArg(arguments, i)))
                return arg;

View Full Code Here

    /** Load process customization settings from data for this project. */
    private void loadGenericVariables() {
        DataRepository data = getDataRepository();
        String prefix = getPrefix();
        SimpleData d;
        d = data.getSimpleValue(prefix + "/" + SHOW_SIZE_NAME);
        showSize = (d != null && d.test());
        d = data.getSimpleValue(prefix + "/" + SHOW_DEF_NAME);
        showDefects = (d != null && d.test());
        d = data.getSimpleValue(prefix + "/" + UNITS_NAME);
        if (d == null) {
            unit = "Unit"; units = "Units";
        } else {
            units = d.format();
            int semicolonPos = units.indexOf(';');
            if (semicolonPos > -1) {
                unit  = units.substring(0, semicolonPos);
                units = units.substring(semicolonPos+1);
            } else if (units.endsWith("s")) {
View Full Code Here

                                      ObjectCache cache,
                                      String taskListName) {
        String globalPrefix = MAIN_DATA_PREFIX + taskListName;
        String dataName =
            data.createDataName(globalPrefix, TASK_LISTS_DATA_NAME);
        SimpleData listVal = data.getSimpleValue(dataName);
        ListData list = null;
        if (listVal instanceof ListData)
            list = (ListData) listVal;
        else if (listVal instanceof StringData)
            list = ((StringData) listVal).asList();
View Full Code Here

        return result;
    }
    /** get the name of the person who owns the data in the repository */
    protected String getOwner() {
        DataRepository data = getDataRepository();
        SimpleData val = data.getSimpleValue("/Owner");
        if (val == null) return null;
        String result = val.format();
        if ("Enter your name".equals(result))
            return null;
        else
            return result;
    }
View Full Code Here

        }
    }


    private void loadStructuralData() {
        SimpleData d = getValue(TASK_ORDINAL_PREFIX + taskListName);
        if (d instanceof NumberData)
            taskOrdinal = savedTaskOrdinal = ((NumberData) d).getInteger();

        d = getValue(TASK_PRUNING_PREFIX + taskListName);
        if (d instanceof NumberData)
View Full Code Here

        if (newTaskListName != null && newValue != defaultValue) {
            String newDataName = dataNamePrefix + newTaskListName;
            if (newDataName.equals(oldDataName)) oldDataName = null;
            if (newValue != savedValue || oldDataName != null) {
                SimpleData d = new DoubleData(newValue, false);
                String dataName = data.createDataName(fullName, newDataName);
                data.putValue(dataName, d);
            }
        }
View Full Code Here

     *
     * This method <b>must</b> be thread-safe.
     */
    public Object call(List arguments, ExpressionContext context)
    {
        SimpleData result = null;

        arguments = collapseLists(arguments, 0);
        for (int i = 0;  i < arguments.size();  i++)
            if (result == null ||
                result.lessThan(getArg(arguments, i)))
                result = getArg(arguments, i);

        return result;
    }
View Full Code Here

            taskListID = taskListName.substring(0, pos);
            taskListName = taskListName.substring(pos+XMLID_FLAG.length());
        }

        String dataName = data.createDataName(taskListName, XML_DATA_NAME);
        SimpleData value = data.getSimpleValue(dataName);
        if (!(value instanceof StringData) && taskListID != null) {
            dataName = getDataNameForID(data, taskListID);
            if (dataName != null)
                value = data.getSimpleValue(dataName);
        }

        if (value instanceof StringData)
            return value.format();
        else
            return null;
    }
View Full Code Here

TOP

Related Classes of pspdash.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.