Results 1 to 2 of 2

Thread: Queuing Nodes

  1. #1
    m4773rz is offline Member
    Join Date
    Jan 2012
    Rep Power

    Default Queuing Nodes

    I am trying to make a basic program for an Air traffic controller to land planes as the come in using nodes but i cant get the nodes to order properly as when i add a new one in it deletes the first node.

    here is my code for the ordering of the nodes.

    Java Code:
    public void addPlane (PlaneNode planeIn) {
        if (start == null) {
            start = planeIn;
            end = planeIn;
            end = start;
            System.out.println("Thank you the plane has been added");
           } else {
    //        if(end == start ){
    //        // get the lastNode in queue
    //        PlaneNode currentFirst = new PlaneNode ();
    //        currentFirst = this.getEnd();
    //        currentFirst.setNext(planeIn);
    //        planeIn.setPrevious(currentFirst);
    //        planeIn.setNext(null);
    //        end = planeIn;
    //        System.out.println(currentFirst.toString());
    //        System.out.println(planeIn.toString());
    //        System.out.println("Thank you the plane has been added1");
    //             } else {
           // if already nodes in queue
           // get the lastNode in queue
            PlaneNode currentLast = this.getEnd();
             //  current update 
            // new plane update
            // update queue's last value to point to new plane 
            this.end = planeIn;
            System.out.println("Thank you the plane has been added2");
    The add planeIn PlaneNode works fine. Any help would be great. Thanks
    Last edited by Norm; 01-04-2012 at 11:02 PM. Reason: added code tags

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power

    Default Re: Queuing Nodes

    Could you provide some print out that shows what is happening?
    What is the code you posted supposed to do?

    How can it be tested? Can you provide a small class with a main method that calls the posted method and shows the problem?

Similar Threads

  1. Inserting Nodes
    By myst in forum New To Java
    Replies: 2
    Last Post: 07-12-2010, 04:26 PM
  2. Problem with Nodes - need help!
    By Smithy in forum New To Java
    Replies: 3
    Last Post: 03-20-2010, 03:47 PM
  3. nodes
    By Dr Gonzo in forum New To Java
    Replies: 1
    Last Post: 12-08-2008, 04:22 PM
  4. nodes in java
    By ahsan in forum New To Java
    Replies: 0
    Last Post: 12-26-2007, 03:09 PM
  5. Queuing Bulk Web request For Later Execution
    By kathiravan in forum Web Frameworks
    Replies: 0
    Last Post: 10-31-2007, 11:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts