当前位置: 首页>>代码示例>>Java>>正文


Java DAG.getNode方法代码示例

本文整理汇总了Java中org.javarosa.core.util.DAG.getNode方法的典型用法代码示例。如果您正苦于以下问题:Java DAG.getNode方法的具体用法?Java DAG.getNode怎么用?Java DAG.getNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.javarosa.core.util.DAG的用法示例。


在下文中一共展示了DAG.getNode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: propagateMarkToDAG

import org.javarosa.core.util.DAG; //导入方法依赖的package包/类
/**
 * Propogates the provided mark in a chain from all nodes which meet the mask to all of their
 * neighboring nodes, as long as those nodes meet the relationship provided. If the relationship
 * is null, only the mask is checked.
 *
 * @param dag
 * @param walkFromSourceToSink If true, start at sources (nodes with only outgoing edges), and walk edges
 *                             from parent to child. If false, start at sinks (nodes with only incoming edges)
 *                             and walk from child to parent
 * @param maskCondition        A mask for what nodes meet the criteria of being marked in the walk.
 * @param markToApply          A new binary flag (or set of flags) to apply to all nodes meeting the criteria
 * @param relationship         If non-null, an additional criteria for whether a node should be marked.
 *                             A node will only be marked if the edge walked to put it on the stack
 *                             meets this criteria.
 */
private static void propagateMarkToDAG(DAG<String, int[], String> dag, boolean walkFromSourceToSink,
                                int maskCondition, int markToApply, String relationship,
                                boolean requireOpenDestination) {
    Stack<String> toProcess = walkFromSourceToSink ? dag.getSources() : dag.getSinks();
    while (!toProcess.isEmpty()) {
        // current node
        String index = toProcess.pop();
        int[] node = dag.getNode(index);

        Vector<Edge<String, String>> edgeSet = walkFromSourceToSink ? dag.getChildren(index) :
                dag.getParents(index);

        for (Edge<String, String> edge : edgeSet) {
            if (caseStatusIs(node[0], maskCondition) && (relationship == null || edge.e.equals(relationship))) {
                if(!requireOpenDestination || caseStatusIs(dag.getNode(edge.i)[0], STATUS_OPEN)) {
                    dag.getNode(edge.i)[0] |= markToApply;
                }
            }
            toProcess.addElement(edge.i);
        }
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:38,代码来源:CasePurgeFilter.java

示例2: propagateMarkToDAG

import org.javarosa.core.util.DAG; //导入方法依赖的package包/类
/**
 * Propogates the provided mark in a chain from all nodes which meet the mask to all of their
 * neighboring nodes, as long as those nodes meet the relationship provided. If the relationship
 * is null, only the mask is checked.
 *
 * @param walkFromSourceToSink If true, start at sources (nodes with only outgoing edges), and walk edges
 *                             from parent to child. If false, start at sinks (nodes with only incoming edges)
 *                             and walk from child to parent
 * @param maskCondition        A mask for what nodes meet the criteria of being marked in the walk.
 * @param markToApply          A new binary flag (or set of flags) to apply to all nodes meeting the criteria
 * @param relationship         If non-null, an additional criteria for whether a node should be marked.
 *                             A node will only be marked if the edge walked to put it on the stack
 *                             meets this criteria.
 */
private static void propagateMarkToDAG(DAG<String, int[], String> dag, boolean walkFromSourceToSink,
                                int maskCondition, int markToApply, String relationship,
                                boolean requireOpenDestination) {
    Stack<String> toProcess = walkFromSourceToSink ? dag.getSources() : dag.getSinks();
    while (!toProcess.isEmpty()) {
        // current node
        String index = toProcess.pop();
        int[] node = dag.getNode(index);

        Vector<Edge<String, String>> edgeSet = walkFromSourceToSink ? dag.getChildren(index) :
                dag.getParents(index);

        for (Edge<String, String> edge : edgeSet) {
            if (caseStatusIs(node[0], maskCondition) && (relationship == null || edge.e.equals(relationship))) {
                if(!requireOpenDestination || caseStatusIs(dag.getNode(edge.i)[0], STATUS_OPEN)) {
                    dag.getNode(edge.i)[0] |= markToApply;
                }
            }
            toProcess.addElement(edge.i);
        }
    }
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:37,代码来源:CasePurgeFilter.java

示例3: propagateAvailabile

import org.javarosa.core.util.DAG; //导入方法依赖的package包/类
private static void propagateAvailabile(DAG<String, int[], String> g) {
    for (Enumeration e = g.getIndices(); e.hasMoreElements(); ) {
        String index = (String)e.nextElement();
        int[] node = g.getNode(index);
        if (caseStatusIs(node[0], STATUS_OPEN | STATUS_RELEVANT) &&
                !hasOutgoingExtension(g, index)) {
            node[0] |= STATUS_AVAILABLE;
        }
    }
    propagateMarkToDAG(g, false, STATUS_AVAILABLE, STATUS_AVAILABLE, CaseIndex.RELATIONSHIP_EXTENSION, true);
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:12,代码来源:CasePurgeFilter.java

示例4: propagateLive

import org.javarosa.core.util.DAG; //导入方法依赖的package包/类
private static void propagateLive(DAG<String, int[], String> g) {
    for (Enumeration e = g.getIndices(); e.hasMoreElements(); ) {
        String index = (String)e.nextElement();
        int[] node = g.getNode(index);
        if (caseStatusIs(node[0], STATUS_OWNED | STATUS_RELEVANT | STATUS_AVAILABLE)) {
            node[0] |= STATUS_ALIVE;
        }
    }

    propagateMarkToDAG(g, true, STATUS_ALIVE, STATUS_ALIVE);
    propagateMarkToDAG(g, false, STATUS_ALIVE, STATUS_ALIVE, CaseIndex.RELATIONSHIP_EXTENSION, true);
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:13,代码来源:CasePurgeFilter.java


注:本文中的org.javarosa.core.util.DAG.getNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。