mx.utils.LinkedList の回し方

by taiga
♥1 | Line 27 | Modified 2012-03-05 14:35:38 | MIT License
play

ActionScript3 source code

/**
 * Copyright taiga ( http://wonderfl.net/user/taiga )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/rhQn
 */

<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx = "http://ns.adobe.com/mxml/2009"
xmlns:s  = "library://ns.adobe.com/flex/spark"
fontSize = "20"
>

<fx:Script>
<![CDATA[
    import mx.utils.LinkedList;
    import mx.utils.LinkedListNode;
    protected override function createChildren():void {
        super.createChildren();
        var list:LinkedList = new LinkedList();
        list.push("a");
        list.push("b");
        var node:LinkedListNode = list.head;
        var isTail:Boolean = ( node == list.tail );
        while(!isTail) {
            ta.appendText("node = " + node + " node.value = " + node.value + "\n");
            isTail = ( node == list.tail );
            node = node.next;
        }
    }
]]>
</fx:Script>
<s:TextArea id="ta" width="100%" height="100%" editable="false" />

</s:Application>

Forked