Class |
Line # |
Actions |
|||
---|---|---|---|---|---|
SequenceNode | 29 | 13 | 12 |
1 | /* | |
2 | * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) | |
3 | * Copyright (C) $$Year-Rel$$ The Jalview Authors | |
4 | * | |
5 | * This file is part of Jalview. | |
6 | * | |
7 | * Jalview is free software: you can redistribute it and/or | |
8 | * modify it under the terms of the GNU General Public License | |
9 | * as published by the Free Software Foundation, either version 3 | |
10 | * of the License, or (at your option) any later version. | |
11 | * | |
12 | * Jalview is distributed in the hope that it will be useful, but | |
13 | * WITHOUT ANY WARRANTY; without even the implied warranty | |
14 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR | |
15 | * PURPOSE. See the GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with Jalview. If not, see <http://www.gnu.org/licenses/>. | |
19 | * The Jalview Authors are detailed in the 'AUTHORS' file. | |
20 | */ | |
21 | package jalview.datamodel; | |
22 | ||
23 | /** | |
24 | * DOCUMENT ME! | |
25 | * | |
26 | * @author $author$ | |
27 | * @version $Revision$ | |
28 | */ | |
29 | public class SequenceNode extends BinaryNode<SequenceI> | |
30 | { | |
31 | private boolean placeholder = false; | |
32 | ||
33 | /** | |
34 | * Creates a new SequenceNode object. | |
35 | */ | |
36 | 20 | public SequenceNode() |
37 | { | |
38 | 20 | super(); |
39 | } | |
40 | ||
41 | 396 | public SequenceNode(SequenceI val, BinaryNode<SequenceI> parent, |
42 | String name, double dist, int bootstrap, boolean dummy) | |
43 | { | |
44 | 396 | super(val, parent, name, dist, bootstrap, dummy); |
45 | } | |
46 | ||
47 | 0 | public SequenceNode(SequenceI element, BinaryNode<SequenceI> parent, |
48 | String name, double dist, int bootstrap) | |
49 | { | |
50 | 0 | super(element, parent, name, dist, bootstrap); |
51 | } | |
52 | ||
53 | 0 | public SequenceNode(SequenceI element, BinaryNode<SequenceI> parent, |
54 | String name, double dist) | |
55 | { | |
56 | 0 | super(element, parent, name, dist); |
57 | } | |
58 | ||
59 | /* | |
60 | * @param placeholder is true if the sequence refered to in the element node | |
61 | * is not actually present in the associated alignment | |
62 | */ | |
63 | 185 | public boolean isPlaceholder() |
64 | { | |
65 | 185 | return placeholder; |
66 | } | |
67 | ||
68 | /** | |
69 | * DOCUMENT ME! | |
70 | * | |
71 | * @param Placeholder | |
72 | * DOCUMENT ME! | |
73 | */ | |
74 | 38 | public void setPlaceholder(boolean Placeholder) |
75 | { | |
76 | 38 | this.placeholder = Placeholder; |
77 | } | |
78 | ||
79 | /** | |
80 | * test if this node has a name that might be a label rather than a bootstrap | |
81 | * value | |
82 | * | |
83 | * @return true if node has a non-numeric label | |
84 | */ | |
85 | 0 | public boolean isSequenceLabel() |
86 | { | |
87 | 0 | if (name != null && name.length() > 0) |
88 | { | |
89 | 0 | for (int c = 0, s = name.length(); c < s; c++) |
90 | { | |
91 | 0 | char q = name.charAt(c); |
92 | 0 | if ('0' <= q && q <= '9') |
93 | { | |
94 | 0 | continue; |
95 | } | |
96 | 0 | return true; |
97 | } | |
98 | } | |
99 | 0 | return false; |
100 | } | |
101 | } |