title: Java - I was modifying a stack linked list into a queue linked list but my dequeue method still behaves like pop
body: <p><code>private Node back</code> isn't used yet, and <code>enqueue</code> (which was push) and <code>dequeue</code> (which was pop) haven't really been modified except for renaming some things. Again, this was originally a stack but I'm trying to modify it into a queue. I've done non-linked list queues and stacks before with <code>int</code>s, but with objects and linked lists I'm sort of lost.</p>
  
  <pre><code>public class DogQueue 
  {
      private Node front = null;
      private Node back = null;
      private Node element = null;
      private int counter = 0;
  </code></pre>
  
  <p>The above is just setting up variables.</p>
  
  <pre><code>  private class Node //This sets up the Linked List
                       //Data Structure with nodes.
    {
        private Dog doggy;
        private Node nextNode;
        private Node firstNode;
  
        Node(Dog newDog)
        {
            doggy = newDog;
        }    
    }
  </code></pre>
  
  <p>Node stuff which I don't quite understand is above.</p>
  
  <pre><code>  public void enqueue(Dog aDog) //This should enqueue
                                  //an object of type Dog.
    {       
        Node dogNode = new Node(aDog);
        dogNode.nextNode = front;
        counter++;
        front = dogNode;
    }
  </code></pre>
  
  <p>The above here is unmodified from the push method, just renamed.</p>
  
  <pre><code>  public Dog dequeue()      //This should output
                              //the first entry in the list.
    {
        Dog firstDog = front.doggy;
        element = front.firstNode;
        counter--;
        return firstDog;
    }
  </code></pre>
  
  <p>The above here is where I'm having the most trouble- currently it behaves like pop (getting and removing the last entered element in the list).</p>
  
  <pre><code>  public boolean isFull()   //Checks to see if List is Full.
    {
        return ( counter == 5 );
    }
  </code></pre>
  
  <p>I set up the counter to just go up to 5 so I can debug isFull.</p>
  
  <pre><code>  public boolean isEmpty()  //Checks to see if List is empty
    {
        if ( counter == 0 )
          {
              return true;
          } else {
              return false;
          }
    }
  </code></pre>
  
  <p>This just says if counter is zero, then isEmpty is true (otherwise false).</p>
  
  <pre><code>}
  </code></pre>