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

com.wselwood.mpcreader.columns.FloatColumn Maven / Gradle / Ivy

There is a newer version: 0.1.1
Show newest version
package com.wselwood.mpcreader.columns;

import com.wselwood.mpcreader.InvalidDataException;

/**
 * Created by wselwood on 15/04/14.
 */
public class FloatColumn implements Column {

    public FloatColumn(int start, int end, Container row) {
        this.start = start;
        this.count = end - start;
        this.row = row;
    }

    @Override
    public void process(char[] buffer) throws InvalidDataException {
        String value = new String(buffer, start, count).trim();
        if(!value.isEmpty()) {
            row.set(Double.parseDouble(value));
        }
    }

    private final int start;
    private final int count;
    private final Container row;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy