Search in sources :

Example 1 with Node

use of Nodes.Node in project psu172 by basit388.

the class Tester method main.

public static void main(String[] s) {
    Node k1 = new Node();
    k1.val = 10;
    Node k2 = new Node(20);
    Node k3 = k2;
    System.out.println(k1.val);
    System.out.println(k2.val);
    System.out.println(k3.val);
}
Also used : Node(Nodes.Node)

Example 2 with Node

use of Nodes.Node in project psu172 by basit388.

the class Tester3 method main.

public static void main(String[] s) {
    Node k1 = new Node(10);
    k1.next = new Node(20);
    // Temp Node
    Node temp = k1;
    System.out.println(temp.val);
    // moving Temp to next node in the chain
    temp = temp.next;
    System.out.println(temp.val);
}
Also used : Node(Nodes.Node)

Example 3 with Node

use of Nodes.Node in project psu172 by basit388.

the class Tester4 method main.

public static void main(String[] s) {
    Node k1 = new Node(10);
    k1.next = new Node(20);
    k1.next.next = new Node(30);
    // Temp Node
    Node temp = k1;
    System.out.println(temp.val);
    // moving Temp to next node in the chain
    temp = temp.next;
    System.out.println(temp.val);
    temp = temp.next;
    System.out.println(temp.val);
}
Also used : Node(Nodes.Node)

Example 4 with Node

use of Nodes.Node in project psu172 by basit388.

the class Tester5 method main.

public static void main(String[] s) {
    Node k1 = new Node(10);
    k1.next = new Node(20);
    k1.next.next = new Node(30);
    // Temp Node
    Node temp = k1;
    while (temp != null) {
        System.out.println(temp.val);
        temp = temp.next;
    }
}
Also used : Node(Nodes.Node)

Example 5 with Node

use of Nodes.Node in project psu172 by basit388.

the class Tester6 method main.

public static void main(String[] s) {
    int SIZE = 10;
    Node Head = new Node(1);
    Node temp = Head;
    for (int i = 2; i < SIZE; i++) {
        temp.next = new Node(i);
        temp = temp.next;
    }
    // Head points to the first node in the chain
    // Its important not to loose the head reference
    // Lets see what was created using Head.
    // Again work with a temp reference
    temp = Head;
    while (temp != null) {
        System.out.println(temp.val);
        temp = temp.next;
    }
}
Also used : Node(Nodes.Node)

Aggregations

Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)112 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)58 Nodes (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes)56 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)54 NodeId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)43 Test (org.junit.Test)21 Flow (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow)20 FlowId (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId)19 TableKey (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey)19 FlowKey (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey)19 NodeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef)17 BigInteger (java.math.BigInteger)16 ArrayList (java.util.ArrayList)16 NodeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder)16 ReadOnlyTransaction (org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction)15 Before (org.junit.Before)11 NodeConnectorId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId)8 ReadFailedException (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)7 MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)7 Optional (com.google.common.base.Optional)6