All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.skjolber.stcsv.column.bi.DoubleCsvColumnValueConsumer Maven / Gradle / Ivy

There is a newer version: 1.0.25
Show newest version
package com.github.skjolber.stcsv.column.bi;

import java.util.function.ObjDoubleConsumer;

public class DoubleCsvColumnValueConsumer implements CsvColumnValueConsumer {

	protected final ObjDoubleConsumer setter;
		
	public DoubleCsvColumnValueConsumer(ObjDoubleConsumer setter) {
		this.setter = setter;
	}

	@Override
	public void consume(T object, char[] array, int start, int end) {
		setter.accept(object, parseDouble(array, start, end));
	}

	public static double parseDouble(char[] array, int start, int end) {
		return Double.parseDouble(new String(array, start, end - start));
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy