Examples of ListNode


Examples of adt.ListNode

    if (list == null || list.head == null) {
      return false;
    }
   
    // get the middle node
    ListNode fast = list.head;
    ListNode slow = list.head;
    ListNode prev = null;
   
    while (fast != null && fast.next != null) {
      prev = slow;
      slow = slow.next;
      fast = fast.next.next;
    }
   
    // 奇数长度, 记录下正中间的点
    // 1  2  3  2  1
    //    p  s     f
    if (fast != null) {
      slow = slow.next;
    }
   
    // 分割成两条链表
    prev.next = null;
   
    // 反转右边一半
    ListNode second_half = reverse(slow);
   
    return compareLists(list.head, second_half);
   
  }
View Full Code Here

Examples of com.arjuna.ats.tools.objectstorebrowser.treenodes.ListNode

                                UidNode uidNode,
                                StatePanel infoPanel) throws ObjectStoreException
    {
        Uid theUid = uidNode.getUid();
        ArjunaTransactionWrapper ba = new ArjunaTransactionWrapper(theUid,getObjectName(os), type);
        ListNode node;
        SubTreeViewEntry entry;

        manipulator.clearEntries();

        if ( !activate(ba) )
        {
            infoPanel.reportError("Failed to activate transaction");

            node = new TxInfoNode("Tx Info", ba, type);
            entry = new TxInfoViewEntry(type, "Info", node);
            addNode(manipulator, node, entry, "Basic Information");
        }
        else
        {
            node = new TxInfoNode("Tx Info", ba, type);
            entry = new TxInfoViewEntry(type, "Info", node);
            addNode(manipulator, node, entry, "Basic Information");
           
            manipulator.createEntry(node = new PreparedListNode("Prepared List", ba, type));
            node.setIconPanelEntry(entry = new PreparedViewEntry(type, "Prepared List", node));
            entry.setToolTipText(getListSize(ba.getPreparedList())+" entries");
            node.add(new DefaultMutableTreeNode(""));

            manipulator.createEntry(node = new PendingListNode("Pending List", ba, type));
            node.setIconPanelEntry(entry = new PendingViewEntry(type, "Pending List", node));
            entry.setToolTipText(getListSize(ba.getPendingList())+" entries");
            node.add(new DefaultMutableTreeNode(""));

            manipulator.createEntry(node = new HeuristicListNode("Heuristic List", ba, type));
            node.setIconPanelEntry(entry = new HeuristicViewEntry(type, "Heuristic List", node));
            entry.setToolTipText(getListSize(ba.getHeuristicList())+" entries");
            node.add(new DefaultMutableTreeNode(""));

            manipulator.createEntry(node = new FailedListNode("Failed List", ba, type));
            node.setIconPanelEntry(entry = new FailedViewEntry(type, "Failed List", node));
            entry.setToolTipText(getListSize(ba.getFailedList())+" entries");
            node.add(new DefaultMutableTreeNode(""));

            manipulator.createEntry(node = new ReadOnlyListNode("Read-only List", ba, type));
            node.setIconPanelEntry(entry = new ReadOnlyViewEntry(type, "Read-only List", node));
            entry.setToolTipText(getListSize(ba.getReadOnlyList())+" entries");
            node.add(new DefaultMutableTreeNode(""));
        }
    }
View Full Code Here

Examples of com.arjuna.ats.tools.objectstorebrowser.treenodes.ListNode

            delegate = (Transaction)((TxInputObjectState)ios).getRealObject();

        LiveAtomicActionWrapper aaw = new LiveAtomicActionWrapper(delegate, theUid, getObjectName(os), type);
        manipulator.clearEntries();

        ListNode node;
        SubTreeViewEntry entry;

        node = new TxInfoNode("Tx Info", aaw, type);
        entry = new TxInfoViewEntry(type, "Info", node);
        addNode(manipulator, node, entry, "Basic Information");
View Full Code Here

Examples of com.arjuna.ats.tools.objectstorebrowser.treenodes.ListNode

    }

    public void iconSelected(IconPanelEntry icon, boolean selected)
    {
        StatePanel panel = BrowserFrame.getStatePanel();
        final ListNode node = (ListNode) getNode();
        BasicActionInfo ba = (BasicActionInfo) node.getAssObject();
        RecordList list = getList(ba);

        panel.clear();
        panel.setType(getTypeName());
        panel.setInfo(list.size()+" entries");
View Full Code Here

Examples of lec09.glab.structs.ListNode

   
    int nHash = obj.hashCode();
    nHash = Math.abs(nHash);
    nHash = nHash % nodVals.length;
   
    ListNode nodCurrent = nodVals[nHash];
    //nCount++;
    while(nodCurrent != null){
      nCount++;
      if(nodCurrent.getValue().equals(obj)){
        strR += obj + " found at " + nHash + " : ";
        break;
      }
     
      nodCurrent = nodCurrent.getNext();
    }
   
    strR +=  nCount + " iterations.";
    return strR;
   
View Full Code Here

Examples of leetcode.ListNode

import leetcode.ListNode;

public class Solution2_1 {
    public ListNode deleteDup(ListNode head) {
        ListNode first = head;
        while (first != null) {
            ListNode pre = first;
            ListNode cur = first.next;
            while(cur != null) {
                if (cur.val == first.val)
                    pre.next = cur.next;
                else
                    pre = cur;
View Full Code Here

Examples of macromedia.asc.parser.ListNode

    public Node coerce(Node expr, TypeInfo[] actual, TypeInfo expected, boolean isExplicit, boolean force)
    {
        if (expr instanceof ListNode)
        {
            // compound expression.  Only coerce the final expr in the list.
            ListNode list = (ListNode) expr;
            Node lastExpr = list.items.back();
            lastExpr = coerce(lastExpr, actual, expected, isExplicit, force);
            list.items.pop_back();
            list.items.push_back(lastExpr);
            return expr;
View Full Code Here

Examples of macromedia.asc.parser.ListNode

        //generate <ClassName>._skinParts
        IdentifierNode identifier = AbstractSyntaxTreeUtil.generateIdentifier(nodeFactory, _SKINPARTS, false);
        GetExpressionNode selector = nodeFactory.getExpression(identifier);
      
        MemberExpressionNode memberExpression = nodeFactory.memberExpression(null, selector);
        ListNode list = nodeFactory.list(null, memberExpression);

        //return <ClassName>._skinParts
        ReturnStatementNode returnStatement = nodeFactory.returnStatement(list);
        StatementListNode rStatementList = nodeFactory.statementList(null, returnStatement);
       
View Full Code Here

Examples of macromedia.asc.parser.ListNode

        argumentList = nodeFactory.argumentList(argumentList, valueExpr);
        CallExpressionNode callExpression =
            (CallExpressionNode) nodeFactory.callExpression(identifier, argumentList);
        callExpression.setRValue(false);
        MemberExpressionNode memberExpression = nodeFactory.memberExpression(lvalueBase, callExpression);
        ListNode list = nodeFactory.list(null, memberExpression);
        ExpressionStatementNode expressionStatement = nodeFactory.expressionStatement(list);
        return nodeFactory.statementList(statementList, expressionStatement);
    }
View Full Code Here

Examples of macromedia.asc.parser.ListNode

        Node value = generateValueExpr(nodeFactory, configNamespaces, generateDocComments);
        ArgumentListNode argumentList = nodeFactory.argumentList(null, value);
        SetExpressionNode setExpression = nodeFactory.setExpression(expr, argumentList, false);
    setExpression.setMode(Tokens.LEFTBRACKET_TOKEN);
        MemberExpressionNode memberExpression = nodeFactory.memberExpression(lvalueBase, setExpression);
        ListNode list = nodeFactory.list(null, memberExpression);
        ExpressionStatementNode expressionStatement = nodeFactory.expressionStatement(list);
        return nodeFactory.statementList(statementList, expressionStatement);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.