Examples of peekChar()


Examples of org.apache.jena.atlas.io.PeekReader.peekChar()

    }
   
    @Test public void unread1()
    {
        PeekReader r = make("abc") ;
        assertEquals('a', r.peekChar()) ;
        r.pushbackChar('Z') ;
        assertEquals('Z', r.peekChar()) ;
        contains(r, "Zabc") ;
    }
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekReader.peekChar()

    @Test public void unread1()
    {
        PeekReader r = make("abc") ;
        assertEquals('a', r.peekChar()) ;
        r.pushbackChar('Z') ;
        assertEquals('Z', r.peekChar()) ;
        contains(r, "Zabc") ;
    }

    @Test public void unread2()
    {
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekReader.peekChar()

        PeekReader r = make("abc") ;
        checkLineCol(r, INIT_LINE, INIT_COL) ;
        int ch = r.readChar() ;
        // Pushback does not move line/col backwards.
        checkLineCol(r, INIT_LINE, INIT_COL+1) ;
        assertEquals('b', r.peekChar()) ;
        checkLineCol(r, INIT_LINE, INIT_COL+1) ;
        r.pushbackChar('a') ;
        checkLineCol(r, INIT_LINE, INIT_COL+1) ;
        contains(r, "abc") ;
    }
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekReader.peekChar()

   
    @Test public void unread3()
    {
        PeekReader r = make("") ;
        int ch = r.readChar() ;
        assertEquals(-1, r.peekChar()) ;
        r.pushbackChar('a') ;
        contains(r, "a") ;
    }

    @Test public void unread4()
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekReader.peekChar()

    @Test public void unread4()
    {
        PeekReader r = make("") ;
        int ch = r.readChar() ;
        assertEquals(-1, r.peekChar()) ;
        r.pushbackChar('0') ;
        r.pushbackChar('1') ;
        r.pushbackChar('2') ;
        r.pushbackChar('3') ;
        contains(r, "3210") ;   // Backwards!
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekReader.peekChar()

       
        checkLineCol(r, lineNum, colNum) // Unmoved.
        r.pushbackChar('2') ;
        r.pushbackChar('3') ;
        checkLineCol(r, lineNum, colNum) // Unmoved.
        assertEquals('3', r.peekChar()) ;
        contains(r, "320") ;
    }

    private void checkLineCol(PeekReader r, long lineNum, long colNum)
    {
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekReader.peekChar()

    @Test public void read1()
    {
        PeekReader r = make("") ;
        checkLineCol(r, INIT_LINE, INIT_COL) ;
       
        int x = r.peekChar() ;
        assertEquals(-1, x) ;
        x = r.readChar() ;
        assertEquals(-1, x) ;
        x = r.readChar() ;
        assertEquals(-1, x) ;
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekReader.peekChar()

    {
        // Assumes we start at (1,1)
        PeekReader r = make("a") ;
        checkLineCol(r, INIT_LINE, INIT_COL) ;
       
        int x = r.peekChar() ;
        assertEquals('a', x) ;
        checkLineCol(r, INIT_LINE, INIT_COL) ;
       
        x = r.readChar() ;
        checkLineCol(r, INIT_LINE, INIT_COL+1) ;
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekReader.peekChar()

       
        x = r.readChar() ;
        checkLineCol(r, INIT_LINE, INIT_COL+1) ;
        assertEquals('a', x) ;
       
        x = r.peekChar() ;
        assertEquals(-1, x) ;
       
        x = r.readChar() ;
        assertEquals(-1, x) ;
    }
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekReader.peekChar()

    @Test public void read9()
    {
        PeekReader r = make("a\nb\n") ;
        checkLineCol(r, INIT_LINE, INIT_COL) ;
        int x = r.peekChar() ;
        assertEquals('a', x) ;
        checkLineCol(r, INIT_LINE, INIT_COL) ;
       
        x = r.readChar() ;
        assertEquals('a', x) ;
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.