Search in sources :

Example 81 with ListIterator

use of java.util.ListIterator in project processdash by dtuma.

the class CsvNodeDataImporter method tweakNodes.

private void tweakNodes(List nodes) {
    if (nodes == null)
        return;
    if (nodes.size() > 2) {
        // remove top-down estimates from non-leaf nodes
        ListIterator i = nodes.listIterator(nodes.size());
        WBSNode nextNode = (WBSNode) i.previous();
        tweakInitialsData(nextNode);
        while (i.hasPrevious()) {
            WBSNode node = (WBSNode) i.previous();
            int nodeIndent = node.getIndentLevel();
            int nextIndent = nextNode.getIndentLevel();
            if (nodeIndent < nextIndent) {
                // this node is a parent node.
                node.setAttribute(TIME_PER_PERSON_ATTR, null);
                node.setAttribute(NUM_PEOPLE_ATTR, null);
            } else {
                // this node is a leaf node.
                tweakInitialsData(node);
            }
            node.setAttribute(INITIALS_TEMP, null);
            node.setAttribute(DURATION_TEMP, null);
            nextNode = node;
        }
    }
}
Also used : ListIterator(java.util.ListIterator)

Aggregations

ListIterator (java.util.ListIterator)81 List (java.util.List)30 ArrayList (java.util.ArrayList)29 LinkedList (java.util.LinkedList)26 Iterator (java.util.Iterator)15 AbstractList (java.util.AbstractList)7 AbstractSequentialList (java.util.AbstractSequentialList)6 RandomAccess (java.util.RandomAccess)5 SelectResults (org.apache.geode.cache.query.SelectResults)5 Test (org.junit.Test)5 Map (java.util.Map)4 NoSuchElementException (java.util.NoSuchElementException)4 SipURI (javax.sip.address.SipURI)4 StructTypeImpl (org.apache.geode.cache.query.internal.types.StructTypeImpl)4 File (java.io.File)3 IOException (java.io.IOException)3 SipException (javax.sip.SipException)3 ObjectType (org.apache.geode.cache.query.types.ObjectType)3 StructType (org.apache.geode.cache.query.types.StructType)3 SAML2Exception (com.sun.identity.saml2.common.SAML2Exception)2