Code example for StreamTokenizer

Methods: nextTokenslashStarComments

0
     * @tests java.io.StreamTokenizer#slashStarComments(boolean) 
     */ 
    public void test_slashStarComments_withSTOpen() throws IOException { 
        Reader reader = new CharArrayReader( "t /* t */ t".toCharArray());
 
        StreamTokenizer st = new StreamTokenizer(reader);
        st.slashStarComments(true);
 
        assertEquals(StreamTokenizer.TT_WORD,st.nextToken());
        assertEquals(StreamTokenizer.TT_WORD,st.nextToken());
        assertEquals(StreamTokenizer.TT_EOF,st.nextToken());
    } 
 
    /** 
     * @tests java.io.StreamTokenizer#slashStarComments(boolean) 
     */ 
    public void test_slashStarComments_withSTClosed() throws IOException { 
        Reader reader = new CharArrayReader( "t /* t */ t".toCharArray());
 
        StreamTokenizer st = new StreamTokenizer(reader);
        st.slashStarComments(false);