Examples of peek()


Examples of net.sf.katta.protocol.MasterQueue.peek()

    }
  }

  private MasterQueue mockBlockingOperationQueue() throws InterruptedException {
    MasterQueue queue = mock(MasterQueue.class);
    when(queue.peek()).thenAnswer(new SleepingAnswer());
    return queue;
  }

}
View Full Code Here

Examples of net.sourceforge.chaperon.helpers.IntegerList.peek()

    int tokenindex = -1;   // Index of the token from the input

    while (true)
    {
      state = stack.peek();

      /* ============================= Reading token ================================ */
      if (tokenindex < 0)
      {
        do
View Full Code Here

Examples of net.sourceforge.chaperon.process.extended.CharBuffer.peek()

      fail("Test for IllegalStateException");
    }
    catch (IllegalStateException e) {}

    buffer.back();
    assertEquals("Test text", 'l', buffer.peek());
    buffer.back();
    assertEquals("Test text", 'k', buffer.peek());

    assertTrue("Test if read is possible", buffer.available());
View Full Code Here

Examples of org.apache.abdera.i18n.text.io.PeekAheadInputStream.peek()

    public void testPeekAheadInputStream() throws Exception {
        ByteArrayInputStream in = new ByteArrayInputStream(new byte[] {0x01, 0x02, 0x03, 0x04});
        PeekAheadInputStream pais = new PeekAheadInputStream(in);
        byte[] peek = new byte[2];
        byte[] read = new byte[2];
        pais.peek(peek);
        pais.read(read);
        assertEquals(read[0], peek[0]);
        assertEquals(read[1], peek[1]);
        byte[] newread = new byte[2];
        assertFalse(read[0] == newread[0]);
View Full Code Here

Examples of org.apache.accumulo.core.file.rfile.MultiLevelIndex.Reader.IndexIterator.peek()

    rootIn.close();
    IndexIterator liter = reader.lookup(new Key("000000"));
    int count = 0;
    while (liter.hasNext()) {
      assertEquals(count, liter.nextIndex());
      assertEquals(count, liter.peek().getNumEntries());
      assertEquals(count, liter.next().getNumEntries());
      count++;
    }
   
    assertEquals(num + 1, count);
View Full Code Here

Examples of org.apache.bcel.verifier.structurals.OperandStack.peek()

                    frame = context.getInFrame();
                    InvokeInstruction invoke = (InvokeInstruction)ins.getInstruction();
                    Type[] arguments = invoke.getArgumentTypes(method.getConstantPool());
   
                    OperandStack os = frame.getStack();
                    Type type = os.peek(arguments.length);
                    if (type instanceof UninitializedObjectType) {
                        ObjectType objecttype = ((UninitializedObjectType) type).getInitialized();
                        InstructionList duplicator = duplicateStack(method, invoke, objecttype);
                        InstructionTargeter[] targeter = ins.getTargeters();
View Full Code Here

Examples of org.apache.commons.collections.ArrayStack.peek()

        ArrayStack nsStack = (ArrayStack) namespaces.get(prefix);
        if (nsStack == null) {
            return null;
        }
        try {
            return ((String) nsStack.peek());
        } catch (EmptyStackException e) {
            return null;
        }

    }
View Full Code Here

Examples of org.apache.commons.digester.Digester.peek()

                return;
            }

            // 1) Digest the external SCXML file
            Digester digester = getDigester();
            SCXML scxml = (SCXML) digester.peek(digester.getCount() - 1);
            SCXML parent = root;
            if (parent == null) {
                parent = scxml;
            }
            String path;
View Full Code Here

Examples of org.apache.commons.digester3.Digester.peek()

        BigDecimal archimedesAveragePi = new BigDecimal( "3.1418" );
        String testStackName = "org.apache.commons.digester3.tests.testNamedStackPushPeekPop";
        Digester digester = new Digester();
        assertTrue( "Stack starts empty:", digester.isEmpty( testStackName ) );
        digester.push( testStackName, archimedesAveragePi );
        assertEquals( "Peeked value:", archimedesAveragePi, digester.peek( testStackName ) );
        assertEquals( "Popped value:", archimedesAveragePi, digester.pop( testStackName ) );
        assertTrue( "Stack ends empty:", digester.isEmpty( testStackName ) );

        digester.push( testStackName, "1" );
        digester.push( testStackName, "2" );
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.KeyValueScanner.peek()

  }

  public Result getCurrentRowState() {
    KeyValueScanner scanner = this.memstore.getScanner();
    List<KeyValue> kvs = new ArrayList<KeyValue>();
    while (scanner.peek() != null) {
      try {
        kvs.add(scanner.next());
      } catch (IOException e) {
        // this should never happen - something has gone terribly arwy if it has
        throw new RuntimeException("Local MemStore threw IOException!");
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.