Code example for Scanner

Methods: hasNext

0
     * Method check if more blocks are available 
     * 
     * @return 
     */ 
    public boolean hasMoreBlocks() { 
        return tokenizer.hasNext();
    } 
 
    /** 
     * Method returns next block. 
     * 
     * @return 
     */ 
    public String nextBlock() {
        int counter = 0;
        blockBuilder.setLength(0);
        int tokensToRead = blockLength;
        while (tokenizer.hasNext() && counter < tokensToRead) {
            String block = tokenizer.next().trim();
            if (!block.equals("")) {
                blockBuilder.append(block).append(WORD_SEPARATOR);