2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 package jalview.datamodel;
\r
27 * <p>Description: </p>
29 * <p>Copyright: Copyright (c) 2004</p>
31 * <p>Company: Dundee University</p>
33 * @author not attributable
36 public class AlignmentOrder {
\r
37 // JBPNote : this method would return a vector containing all sequences in seqset
\r
38 // with those also contained in order at the beginning of the vector in the order
\r
39 // given by order. AlignmentSorter.vectorSubsetToArray already does this, but that method
\r
40 // should be here for completeness.
\r
42 /* public Vector getOrder(AlignmentI seqset)
44 Vector perm = new Vector(seqset.getHeight());
45 for (i=0, o = 0, n=seqset.getHeight(), p = Order.size(); i<n; i++)
46 perm.setElement(i,...).
50 public static final int FILE = 0;
\r
51 public static final int MSA = 1;
\r
52 public static final int USER = 2;
\r
53 private int Type = 0;
\r
54 private String Name;
\r
55 private Vector Order = null;
\r
57 public AlignmentOrder() {
\r
63 * @param anOrder Vector
65 public AlignmentOrder(Vector anOrder) {
\r
72 * @param orderFrom AlignmentI
74 public AlignmentOrder(AlignmentI orderFrom) {
\r
75 Order = new Vector();
\r
77 for (int i = 0, ns = orderFrom.getHeight(); i < ns; i++)
\r
78 Order.addElement(orderFrom.getSequenceAt(i));
\r
81 public AlignmentOrder(SequenceI[] orderFrom) {
\r
82 Order = new Vector();
\r
84 for (int i = 0, ns = orderFrom.length; i < ns; i++)
\r
85 Order.addElement(orderFrom[i]);
\r
88 public void setType(int Type) {
\r
92 public int getType() {
\r
96 public void setName(String Name) {
\r
100 public String getName() {
\r
104 public void setOrder(Vector Order) {
\r
105 this.Order = Order;
\r
108 public Vector getOrder() {
\r
115 * @param orderThis AlignmentI
116 * @param byThat AlignmentI
119 /* public AlignmentOrder(AlignmentI orderThis, AlignmentI byThat)
121 // Vector is an ordering of this alignment using the order of sequence objects in byThat,
122 // where ids and unaligned sequences must match