-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDisease.java
52 lines (36 loc) · 992 Bytes
/
Disease.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.google.gwt.bacterialresistance.server;
import java.util.*;
public class Disease {
private String diseaseName;
private LinkedList<String> diseaseRes;
private float[] vals;
private int len = 0;
private static int numOfResGenes;
public Disease(String diseaseName, LinkedList<String> diseaseRes){
this.diseaseName = diseaseName;
this.diseaseRes = diseaseRes;
vals = new float[diseaseRes.size()];
}
public void addResistenceVal(float value){
if(len < vals.length)
vals[len++] = value;
}
public static void setNumOfResGenes(int x){
numOfResGenes = x;
}
public static int getNumOfResGenes(){
return numOfResGenes;
}
public float[] getRes(){
return vals;
}
public String toString(){
String s = "Disease : " + diseaseName + "\n";
int pos = 0;
for(String resName : diseaseRes){
s += diseaseRes.get(pos) + " " + vals[pos] + "\n";
pos++;
}
return s;
}
}