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

lphystudio.core.logger.TreeTextFormatter Maven / Gradle / Ivy

The newest version!
package lphystudio.core.logger;

import lphy.base.evolution.tree.TimeTree;
import lphy.core.logger.ValueFormatter;
import lphy.core.model.Symbols;

public class TreeTextFormatter implements ValueFormatter {

    String valueID;
    TimeTree tree;

//    public NexusTreeFormatter() {
//    }

    public TreeTextFormatter(String valueID, TimeTree tree) {
        this.valueID = Symbols.getCanonical(valueID);
        this.tree = tree;
    }

    @Override
    public String getExtension() {
        return ".txt";
    }

    @Override
    public Mode getMode() {
        return Mode.VALUE_PER_LINE;
    }

    @Override
    public Class getDataTypeClass() {
        return TimeTree.class;
    }

    @Override
    public String getValueID() {
        return valueID;
    }

    @Override
    public String format(TimeTree tree) {
        return tree.toNewick(false);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy