lphystudio.core.logger.AlignmentTextFormatter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lphy-studio Show documentation
Show all versions of lphy-studio Show documentation
The GUI for LPhy language.
The newest version!
package lphystudio.core.logger;
import lphy.base.evolution.alignment.SimpleAlignment;
import lphy.core.logger.ValueFormatter;
import lphy.core.model.Symbols;
public class AlignmentTextFormatter implements ValueFormatter {
SimpleAlignment simpleAlignment;
String valueID;
// boolean isClamped;
// public AlignmentTextFormatter(String valueID, SimpleAlignment simpleAlignment, Boolean isClamped) {
// this.valueID = Symbols.getCanonical(valueID);
// this.simpleAlignment = simpleAlignment;
// this.isClamped = isClamped;
// }
public AlignmentTextFormatter(String valueID, SimpleAlignment simpleAlignment) {
this.valueID = Symbols.getCanonical(valueID);
this.simpleAlignment = simpleAlignment;
}
@Override
public String getExtension() {
return ".txt";
}
@Override
public Mode getMode() {
return Mode.VALUE_PER_FILE;
}
@Override
public Class getDataTypeClass() {
return SimpleAlignment.class;
}
@Override
public String getValueID() {
return valueID;
}
@Override
public String format(SimpleAlignment simpleAlignment) {
return simpleAlignment.toString();
}
}