com.wselwood.mpcreader.columns.HexColumn Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mpc-reader Show documentation
Show all versions of mpc-reader Show documentation
A Reader for minor planet center data files.
package com.wselwood.mpcreader.columns;
import com.wselwood.mpcreader.InvalidDataException;
/**
* Created by wselwood on 18/04/14.
*/
public class HexColumn implements Column {
public HexColumn(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();
row.set(Integer.parseInt(value, 16));
}
private final int start;
private final int count;
private final Container row;
}