Formatted source
[jalview.git] / src / jalview / datamodel / AlignmentOrder.java
1 /*
2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4 *
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.
9 *
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.
14 *
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
18 */\r
19 package jalview.datamodel;\r
20 \r
21 import java.util.*;\r
22 \r
23 \r
24 /**
25  * <p>Title: </p>
26  *
27  * <p>Description: </p>
28  *
29  * <p>Copyright: Copyright (c) 2004</p>
30  *
31  * <p>Company: Dundee University</p>
32  *
33  * @author not attributable
34  * @version 1.0
35  */\r
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
41 \r
42     /*  public Vector getOrder(AlignmentI seqset)
43   {
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,...).
47     return Order;
48   }
49  */\r
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
56 \r
57     public AlignmentOrder() {\r
58     }\r
59 \r
60     /**
61  * AlignmentOrder
62  *
63  * @param anOrder Vector
64  */\r
65     public AlignmentOrder(Vector anOrder) {\r
66         Order = anOrder;\r
67     }\r
68 \r
69     /**
70  * AlignmentOrder
71  *
72  * @param orderFrom AlignmentI
73  */\r
74     public AlignmentOrder(AlignmentI orderFrom) {\r
75         Order = new Vector();\r
76 \r
77         for (int i = 0, ns = orderFrom.getHeight(); i < ns; i++)\r
78             Order.addElement(orderFrom.getSequenceAt(i));\r
79     }\r
80 \r
81     public AlignmentOrder(SequenceI[] orderFrom) {\r
82         Order = new Vector();\r
83 \r
84         for (int i = 0, ns = orderFrom.length; i < ns; i++)\r
85             Order.addElement(orderFrom[i]);\r
86     }\r
87 \r
88     public void setType(int Type) {\r
89         this.Type = Type;\r
90     }\r
91 \r
92     public int getType() {\r
93         return Type;\r
94     }\r
95 \r
96     public void setName(String Name) {\r
97         this.Name = Name;\r
98     }\r
99 \r
100     public String getName() {\r
101         return Name;\r
102     }\r
103 \r
104     public void setOrder(Vector Order) {\r
105         this.Order = Order;\r
106     }\r
107 \r
108     public Vector getOrder() {\r
109         return Order;\r
110     }\r
111 \r
112     /**
113  * AlignmentOrder
114  *
115  * @param orderThis AlignmentI
116  * @param byThat AlignmentI
117  */\r
118 \r
119     /* public AlignmentOrder(AlignmentI orderThis, AlignmentI byThat)
120 {
121   // Vector is an ordering of this alignment using the order of sequence objects in byThat,
122   // where ids and unaligned sequences must match
123
124 } */\r
125 }\r