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
20 package jalview.datamodel;
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
38 public AlignmentOrder()
42 public void setType(int Type)
52 public void setName(String Name)
57 public String getName()
62 public void setOrder(Vector Order)
67 public Vector getOrder()
72 // JBPNote : this method would return a vector containing all sequences in seqset
73 // with those also contained in order at the beginning of the vector in the order
74 // given by order. AlignmentSorter.vectorSubsetToArray already does this, but that method
75 // should be here for completeness.
77 /* public Vector getOrder(AlignmentI seqset)
79 Vector perm = new Vector(seqset.getHeight());
80 for (i=0, o = 0, n=seqset.getHeight(), p = Order.size(); i<n; i++)
81 perm.setElement(i,...).
85 public static final int FILE = 0;
86 public static final int MSA = 1;
87 public static final int USER = 2;
91 private Vector Order = null;
96 * @param anOrder Vector
98 public AlignmentOrder(Vector anOrder)
106 * @param orderFrom AlignmentI
108 public AlignmentOrder(AlignmentI orderFrom)
110 Order = new Vector();
112 for (int i=0,ns=orderFrom.getHeight(); i<ns; i++)
113 Order.addElement(orderFrom.getSequenceAt(i));
115 public AlignmentOrder(SequenceI[] orderFrom) {
116 Order = new Vector();
117 for (int i=0,ns=orderFrom.length; i<ns; i++)
118 Order.addElement(orderFrom[i]);
126 * @param orderThis AlignmentI
127 * @param byThat AlignmentI
129 /* public AlignmentOrder(AlignmentI orderThis, AlignmentI byThat)
131 // Vector is an ordering of this alignment using the order of sequence objects in byThat,
132 // where ids and unaligned sequences must match