Sha256: e0ad2ccdca7301143b6d16f5c275b8392a8ab36502cd1e36b36552e128b00a2e

Contents?: true

Size: 1.47 KB

Versions: 2

Compression:

Stored size: 1.47 KB

Contents

package org.embulk.parser.poi_excel.visitor.embulk;

import org.apache.poi.ss.usermodel.Sheet;
import org.embulk.parser.poi_excel.visitor.PoiExcelVisitorValue;
import org.embulk.spi.Column;

public class DoubleCellVisitor extends CellVisitor {

	public DoubleCellVisitor(PoiExcelVisitorValue visitorValue) {
		super(visitorValue);
	}

	@Override
	public void visitCellValueNumeric(Column column, Object source, double value) {
		pageBuilder.setDouble(column, value);
	}

	@Override
	public void visitCellValueString(Column column, Object source, String value) {
		pageBuilder.setDouble(column, Double.parseDouble(value));
	}

	@Override
	public void visitCellValueBoolean(Column column, Object source, boolean value) {
		pageBuilder.setDouble(column, value ? 1 : 0);
	}

	@Override
	public void visitCellValueError(Column column, Object source, int code) {
		pageBuilder.setDouble(column, code);
	}

	@Override
	public void visitValueLong(Column column, Object source, long value) {
		pageBuilder.setDouble(column, value);
	}

	@Override
	public void visitSheetName(Column column) {
		Sheet sheet = visitorValue.getSheet();
		int index = sheet.getWorkbook().getSheetIndex(sheet);
		pageBuilder.setDouble(column, index);
	}

	@Override
	public void visitRowNumber(Column column, int index1) {
		pageBuilder.setDouble(column, index1);
	}

	@Override
	public void visitColumnNumber(Column column, int index1) {
		pageBuilder.setDouble(column, index1);
	}
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
embulk-parser-poi_excel-0.1.1 src/main/java/org/embulk/parser/poi_excel/visitor/embulk/DoubleCellVisitor.java
embulk-parser-poi_excel-0.1.0 src/main/java/org/embulk/parser/poi_excel/visitor/embulk/DoubleCellVisitor.java