Code example for Scanner

Methods: hasNextnextuseDelimiter

0
	ReadFileByScanner(String fileName){
		this.fileName = fileName;
	} 
	 
	protected Pair processLine(String aLine) {
		Scanner scanner = new Scanner(aLine);
		scanner.useDelimiter("\t");
		int val1 = 0;
		int val2 = 0;
		 
		if (scanner.hasNext()) {
			val1 = Integer.parseInt(scanner.next());
			val2 = Integer.parseInt(scanner.next());
			//System.out.println(val1 + "	" + val2); 
		} 
		return new Pair(val1, val2);
	} 
 
	@Override 
	public List<Pair> call() throws Exception {
Contextual code suggestions in your IDE  Get Codota for Java