Package java.util

Examples of java.util.Queue


    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public void testTransformedQueue_decorateTransform() {
        final Queue originalQueue = new LinkedList();
        final Object[] elements = new Object[] {"1", "3", "5", "7", "2", "4", "6"};
        Collections.addAll(originalQueue, elements);
        final Queue<?> queue = TransformedQueue.transformedQueue(originalQueue,
                TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER);
        assertEquals(elements.length, queue.size());
View Full Code Here


        if (task == null) {
            throw new NullPointerException();
        }

        BlockingQueue workQueue;
        Queue priorityWorkQueue;
        if (partitionId < 0) {
            workQueue = genericWorkQueue;
            priorityWorkQueue = genericPriorityWorkQueue;
        } else {
            OperationThread partitionOperationThread = partitionOperationThreads[toPartitionThreadIndex(partitionId)];
View Full Code Here

  /**
   * Dequeue the object and run the next if it is the first
   * in the queue.
   */
  public void dequeueIfNotDoneYet(Element elem, String name, Object object) {
    @SuppressWarnings("rawtypes")
    Queue queue = queue(elem, name, null);
    if (queue != null && object.equals(queue.peek())) {
      dequeueCurrentAndRunNext(elem, name);
    }
  }
View Full Code Here

    }
    return c;
  }

  private void stop(Element elem, String name, boolean clear, boolean jumpToEnd) {
    @SuppressWarnings("rawtypes")
    Queue q = queue(elem, name, null);
    if (q != null) {
      Object f = q.peek();
      if (clear) {
        q.clear();
      }
      if (f != null) {
        if (f instanceof Function) {
          // pass jumpToEnd to Animation.onCancel() via the element's data object
          $(elem).data(JUMP_TO_END, Boolean.valueOf(jumpToEnd));
View Full Code Here

      assert values.length == s.size();
      assert s.contains(values[0]);
      assert s.contains(values[1]);

      // Queue
      Queue q = (Queue) wrapper.convert(Queue.class);
      assert values.length == q.size();
      assert q.contains(values[0]);
      assert q.contains(values[1]);

      // Concrete class
      ArrayList l = (ArrayList) wrapper.convert(ArrayList.class);
      assert values.length == l.size();
      assertEquals(values[0], l.get(0));
View Full Code Here

        twProd.updateTag(new JTag("anotherone"), 6);
    }

    @Test
    public void testFIFO() {
        Queue q = new LinkedBlockingDeque();
        q.add("test");
        q.add("pest");
        assertEquals("test", q.poll());

        q = new LinkedBlockingQueue();
        q.add("test");
        q.add("pest");
        assertEquals("test", q.poll());

        Stack v = new Stack();
        v.add("test");
        v.add("pest");
        assertEquals("pest", v.pop());
View Full Code Here

        final File tree = new File(base, "tree");
        tree.mkdir();
        final File treeJavascriptFile = new File(base, "tree.js");
        FileUtils.write(treeJavascriptFile, "hello");

        final Queue asyncCallback = mock(Queue.class);
        final ScriptableObject globalScope = new NodeJsGlobal();
        final ModuleScriptProvider moduleScriptProvider = mock(ModuleScriptProvider.class);
        ModuleScript moduleScript = mock(ModuleScript.class);
        when(moduleScript.getUri()).thenReturn(treeJavascriptFile.toURI());
        when(moduleScript.getBase()).thenReturn(treeJavascriptFile.toURI());
View Full Code Here

     */
    @Test(expected = JavaScriptException.class)
    public void testDirectoryRequire() throws Exception {
        final File tree = folder.newFolder("tree");

        final Queue asyncCallback = mock(Queue.class);
        final ScriptableObject globalScope = new NodeJsGlobal();
        final NodeJsUrlModuleSourceProvider moduleSourceProvider = mock(NodeJsUrlModuleSourceProvider.class);
        final ModuleScriptProvider moduleScriptProvider = mock(ModuleScriptProvider.class);
        final Script pre = mock(Script.class);
        final Script post = mock(Script.class);
View Full Code Here

        FileUtils.write(mainJs, "exports.hello = 'bye';" +
                "exports.other = require('other_module');");

        FileUtils.write(otherModuleMain, "exports.text = 'second';");

        final Queue asyncCallback = mock(Queue.class);
        final NodeJsGlobal globalScope = new NodeJsGlobal();
        final ExitCallbackExecutor exitCallbackExecutor =
                mock(ExitCallbackExecutor.class);

View Full Code Here

        FileUtils.write(otherModuleMain, "exports.text = 'second';");
        final ExitCallbackExecutor exitCallbackExecutor =
                mock(ExitCallbackExecutor.class);


        final Queue asyncCallback = mock(Queue.class);
        final NodeJsGlobal globalScope = new NodeJsGlobal();

        ContextFactory contextFactory = new ContextFactory();
        contextFactory.call(new ContextAction() {
            @Override
View Full Code Here

TOP

Related Classes of java.util.Queue

Copyright © 2018 www.massapicom. 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.