com.wselwood.mpcreader.modifiers.ArcLengthModifier 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.modifiers;
import com.wselwood.mpcreader.InvalidDataException;
import com.wselwood.mpcreader.columns.Container;
/**
* Created by wselwood on 03/05/14.
*/
public class ArcLengthModifier implements Modifier {
public ArcLengthModifier(Container num, Container input, Container arcLength) {
this.num = num;
this.input = input;
this.arcLength = arcLength;
}
@Override
public void process() throws InvalidDataException {
if(num.get() <= 1) {
arcLength.set(Integer.parseInt(input.get().split(" ", 2)[0].trim()));
}
else {
arcLength.set(-1);
}
}
private final Container num;
private final Container input;
private final Container arcLength;
}