package org.cipres.kepler.testcase; import org.cipres.CipresIDL.api1.DataMatrix; import org.cipres.CipresIDL.api1.Tree; import org.cipres.datatypes.PhyloDataset; public class TestPhyloDataReaderActor { // tree structure private Tree _tree = null; // data matrix private DataMatrix _dataMatrix = null; // taxa info private String[] _taxaInfo = null; // phylodataset used to store and parse the input data private PhyloDataset _phyloDataset; // set the Nexus data to initialize the phylodataset public void setNexusData(String nexusContent) { try { _phyloDataset = new PhyloDataset(); // initialize the phylodataset with the input data _phyloDataset.initialize( nexusContent ); } catch (Exception ex) { ex.printStackTrace(); if (_phyloDataset!= null) _phyloDataset = null; } _tree = _phyloDataset.getFirstTree(); _dataMatrix = _phyloDataset.getDataMatrix(); _taxaInfo = _phyloDataset.getTaxaInfo(); } // get the first tree in the phylodataset public Tree getTree() { return _tree; } // get the data matrix from the phylodataset public DataMatrix getDataMatrix() { return _dataMatrix; } // get the taxa info from the phylodataset public String[] getTaxaInfo() { return _taxaInfo; } }