Code example for StreamTokenizer

Methods: nextToken, ordinaryChar, slashSlashComments

0
     * @tests java.io.StreamTokenizer#slashSlashComments(boolean) 
     */ 
    public void test_slashSlashComments_withSSOpen_NoComment() throws IOException { 
        Reader reader = new CharArrayReader( "// t".toCharArray());
 
        StreamTokenizer st = new StreamTokenizer(reader);
        st.slashSlashComments(true);
        st.ordinaryChar('/');
 
        assertEquals(StreamTokenizer.TT_EOF,st.nextToken());
    } 
     
    /** 
     * @tests java.io.StreamTokenizer#slashSlashComments(boolean) 
     */ 
    public void test_slashSlashComments_withSSClosed() throws IOException { 
        Reader reader = new CharArrayReader( "// t".toCharArray());
 
        StreamTokenizer st = new StreamTokenizer(reader);
        st.slashSlashComments(false);
        st.ordinaryChar('/');