Package java.util

Examples of java.util.LinkedList.poll()


        Directory directory;

        // Try all of the directories in a breadth first order, hence the
        // reason for the queue to see if any of them can allocate a file.
        queue.add(root);
        while ((directory = (Directory) queue.poll()) != null) {
            File newFile = directory.allocateFile(queue);
            if (newFile != null) {
                return newFile;
            }
        }
View Full Code Here


        }

        // None of them could so now try all of the directories to see if any
        // of them can allocate a directory.
        queue.add(root);
        while ((directory = (Directory) queue.poll()) != null) {

            Directory newDirectory = directory.allocateDirectory(queue);
            if (newDirectory != null) {
                File newFile = newDirectory.allocateFile(null);
                if (newFile != null) {
View Full Code Here

    }

    public void test_poll() {
        assertEquals("should return the head", objArray[0], ll.poll());
        LinkedList list = new LinkedList();
        assertNull("should return 'null' if list is empty", list.poll());
    }

    public void test_remove() {
        for (int i = 0; i < objArray.length; i++) {
            assertEquals("should remove the head", objArray[i], ll.remove());
View Full Code Here

      {
         LinkedList list = lists[index];

         Assert.assertNotNull(list);

         int elem = (Integer)list.poll();

         Assert.assertEquals(messageCount, elem);

         index++;
View Full Code Here

    }

    public void test_poll() {
        assertEquals("should return the head", objArray[0], ll.poll());
        LinkedList list = new LinkedList();
        assertNull("should return 'null' if list is empty", list.poll());
    }

    public void test_remove() {
        for (int i = 0; i < objArray.length; i++) {
            assertEquals("should remove the head", objArray[i], ll.remove());
View Full Code Here

      {
         LinkedList list = lists[index];

         Assert.assertNotNull(list);

         int elem = (Integer)list.poll();

         Assert.assertEquals(messageCount, elem);

         index++;
View Full Code Here

    }

    public void test_poll() {
        assertEquals("should return the head", objArray[0], ll.poll());
        LinkedList list = new LinkedList();
        assertNull("should return 'null' if list is empty", list.poll());
    }

    public void test_remove() {
        for (int i = 0; i < objArray.length; i++) {
            assertEquals("should remove the head", objArray[i], ll.remove());
View Full Code Here

      {
         LinkedList list = lists[index];

         Assert.assertNotNull(list);

         int elem = (Integer)list.poll();

         Assert.assertEquals(messageCount, elem);

         index++;
View Full Code Here

      {
         LinkedList list = lists[index];

         Assert.assertNotNull(list);

         int elem = (Integer)list.poll();

         Assert.assertEquals(messageCount, elem);

         index++;
View Full Code Here

      {
         LinkedList list = lists[index];

         Assert.assertNotNull(list);

         int elem = (Integer)list.poll();

         Assert.assertEquals(messageCount, elem);

         index++;
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.