2 // FORESTER -- software libraries and applications
3 // for evolutionary biology research and applications.
5 // Copyright (C) 2017 Christian M. Zmasek
6 // Copyright (C) 2017 J. Craig Venter Institute
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 // Contact: phyloxml @ gmail . com
24 // WWW: https://sites.google.com/site/cmzmasek/home/software/forester
26 package org.forester.clade_analysis;
28 import java.util.ArrayList;
29 import java.util.List;
31 import org.forester.util.ForesterUtil;
33 public final class ResultSingle {
35 private String _greatest_common_prefix = "";
36 private String _greatest_common_prefix_up = "";
37 private String _greatest_common_prefix_down = "";
38 private final List<String> _warnings = new ArrayList<>();
39 private int _lec_ext_nodes = 0;
40 private int _p_ext_nodes = 0;
41 private String _greatest_common_clade_subtree_confidence = "";
42 private String _greatest_common_clade_subtree_confidence_up = "";
43 private String _greatest_common_clade_subtree_confidence_down = "";
45 public String getGreatestCommonPrefix() {
46 return _greatest_common_prefix;
49 public String getGreatestCommonPrefixUp() {
50 return _greatest_common_prefix_up;
53 public String getGreatestCommonPrefixDown() {
54 return _greatest_common_prefix_down;
57 public String getGreatestCommonCladeSubtreeConfidence() {
58 return _greatest_common_clade_subtree_confidence;
61 public String getGreatestCommonCladeUpSubtreeConfidence() {
62 return _greatest_common_clade_subtree_confidence_up;
65 public String getGreatestCommonCladeDownSubtreeConfidence() {
66 return _greatest_common_clade_subtree_confidence_down;
69 public List<String> getWarnings() {
73 public int getLeastEncompassingCladeSize() {
74 return _lec_ext_nodes;
77 public int getTreeSize() {
81 public final String toString() {
82 final StringBuilder sb = new StringBuilder();
83 sb.append( "Greatest common prefix : " + _greatest_common_prefix );
84 sb.append( ForesterUtil.LINE_SEPARATOR );
85 sb.append( "Greatest common prefix down: " + _greatest_common_prefix_down );
86 sb.append( ForesterUtil.LINE_SEPARATOR );
87 sb.append( "Greatest common prefix up : " + _greatest_common_prefix_up );
91 void addWarning( final String warning ) {
92 _warnings.add( warning );
95 void setGreatestCommonPrefix( final String greatest_common_prefix ) {
96 _greatest_common_prefix = greatest_common_prefix;
99 void setGreatestCommonPrefixUp( final String greatest_common_prefix_up ) {
100 _greatest_common_prefix_up = greatest_common_prefix_up;
103 void setGreatestCommonPrefixDown( final String greatest_common_prefix_down ) {
104 _greatest_common_prefix_down = greatest_common_prefix_down;
107 void setGreatestCommonCladeSubtreeConfidence( final String greatest_common_clade_confidence ) {
108 _greatest_common_clade_subtree_confidence = greatest_common_clade_confidence;
111 void setGreatestCommonCladeUpSubtreeConfidence( final String greatest_common_clade_confidence_up ) {
112 _greatest_common_clade_subtree_confidence_up = greatest_common_clade_confidence_up;
115 void setGreatestCommonCladeDownSubtreeConfidence( final String greatest_common_clade_confidence_down ) {
116 _greatest_common_clade_subtree_confidence_down = greatest_common_clade_confidence_down;
119 void setLeastEncompassingCladeSize( final int lec_ext_nodes ) {
120 _lec_ext_nodes = lec_ext_nodes;
123 void setTreeSize( final int p_ext_nodes ) {
124 _p_ext_nodes = p_ext_nodes;