com.github.skjolber.stcsv.column.bi.DoubleCsvColumnValueConsumer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of databinder Show documentation
Show all versions of databinder Show documentation
High-performance CSV databinding library
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));
}
}