2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.datamodel;
\r
27 * <p>Description: </p>
\r
29 * <p>Copyright: Copyright (c) 2004</p>
\r
31 * <p>Company: Dundee University</p>
\r
33 * @author not attributable
\r
36 public class AlignmentOrder
\r
38 // JBPNote : this method would return a vector containing all sequences in seqset
\r
39 // with those also contained in order at the beginning of the vector in the order
\r
40 // given by order. AlignmentSorter.vectorSubsetToArray already does this, but that method
\r
41 // should be here for completeness.
\r
43 /* public Vector getOrder(AlignmentI seqset)
\r
45 Vector perm = new Vector(seqset.getHeight());
\r
46 for (i=0, o = 0, n=seqset.getHeight(), p = Order.size(); i<n; i++)
\r
47 perm.setElement(i,...).
\r
52 /** DOCUMENT ME!! */
\r
53 public static final int FILE = 0;
\r
55 /** DOCUMENT ME!! */
\r
56 public static final int MSA = 1;
\r
58 /** DOCUMENT ME!! */
\r
59 public static final int USER = 2;
\r
60 private int Type = 0;
\r
61 private String Name;
\r
62 private Vector Order = null;
\r
65 * Creates a new AlignmentOrder object.
\r
67 public AlignmentOrder()
\r
74 * @param anOrder Vector
\r
76 public AlignmentOrder(Vector anOrder)
\r
84 * @param orderFrom AlignmentI
\r
86 public AlignmentOrder(AlignmentI orderFrom)
\r
88 Order = new Vector();
\r
90 for (int i = 0, ns = orderFrom.getHeight(); i < ns; i++)
\r
92 Order.addElement(orderFrom.getSequenceAt(i));
\r
97 * Creates a new AlignmentOrder object.
\r
99 * @param orderFrom DOCUMENT ME!
\r
101 public AlignmentOrder(SequenceI[] orderFrom)
\r
103 Order = new Vector();
\r
105 for (int i = 0, ns = orderFrom.length; i < ns; i++)
\r
107 Order.addElement(orderFrom[i]);
\r
114 * @param Type DOCUMENT ME!
\r
116 public void setType(int Type)
\r
124 * @return DOCUMENT ME!
\r
126 public int getType()
\r
134 * @param Name DOCUMENT ME!
\r
136 public void setName(String Name)
\r
144 * @return DOCUMENT ME!
\r
146 public String getName()
\r
154 * @param Order DOCUMENT ME!
\r
156 public void setOrder(Vector Order)
\r
158 this.Order = Order;
\r
164 * @return DOCUMENT ME!
\r
166 public Vector getOrder()
\r
174 * @param orderThis AlignmentI
\r
175 * @param byThat AlignmentI
\r
178 /* public AlignmentOrder(AlignmentI orderThis, AlignmentI byThat)
\r
180 // Vector is an ordering of this alignment using the order of sequence objects in byThat,
\r
181 // where ids and unaligned sequences must match
\r