Code example for Scanner

Methods: useDelimiter

0
            String msg = "Too long block length. Current: " + n + ". Min allowed: 1" + ". Max allowed: " + MAX_BLOCK_LENGTH;
            logger.error(msg);
            throw new RuntimeException(msg);
        } 
        blockLength = n;
        tokenizer = new Scanner(file);
        tokenizer.useDelimiter(WORD_SEPARATOR);
        blockBuilder = new StringBuilder();
        logger.info("Block extractor created successfully.");
    } 
 
    /** 
     * Method check if more blocks are available 
     * 
     * @return 
     */ 
    public boolean hasMoreBlocks() { 
        return tokenizer.hasNext();
    } 
 
    /**