Merge branch 'Jalview-JS/jim/JAL-3253-JAL-3418' into Jalview-JS/JAL-3253-applet
[jalview.git] / srcjar / fr / orsay / lri / varna / models / rna / ModeleStrand.java
1 package fr.orsay.lri.varna.models.rna;
2
3 import java.util.ArrayList;
4
5 public class ModeleStrand {
6         
7         private ArrayList<ModeleBase> _strand = new ArrayList<ModeleBase>();
8         private boolean hasBeenPlaced = false;
9         private boolean strandLeft = false;
10         private boolean strandRight = false;
11         private int levelPosition;
12         
13         public ModeleStrand(){
14                 
15         }
16         
17         public void addBase(ModeleBase mb){
18                 this._strand.add(mb);
19         }
20         
21         public void addBase(int index, ModeleBase mb){
22                 this._strand.add(index, mb);
23         }
24         
25         public int sizeStrand() {
26                 return this._strand.size();
27         }
28         
29         public ModeleBase getMB(int a) {        
30                 return this._strand.get(a);     
31         }
32         
33         public ArrayList<ModeleBase> getArrayListMB() { 
34                 return this._strand;    
35         }
36         
37         public int getLevelPosition(){
38                 return this.levelPosition;
39         }
40         
41         public void setLevelPosition(int a){
42                 this.levelPosition=a;
43         }
44         
45         public boolean getStrandRight(){
46                 return this.strandRight;
47         }
48         
49         public void setStrandRight(boolean bool){
50                 this.strandRight=bool;
51         }
52         
53         public boolean getStrandLeft(){
54                 return this.strandLeft;
55         }
56         
57         public void setStrandLeft(boolean bool){
58                 this.strandLeft=bool;
59         }
60         
61         public boolean hasBeenPlaced(){
62                 return this.hasBeenPlaced;
63         }
64         
65         public void setHasBeenPlaced(boolean bool){
66                 this.hasBeenPlaced =bool;
67         }
68         
69         public boolean existInStrand(int a){
70                 int size =sizeStrand();
71                 boolean exist=false; 
72                 for (int i=0; i<size;i++){
73                         if(a==this.getMB(i).getIndex()){
74                                 exist=true;
75                         }
76                 }
77                 return exist;
78         }
79 }