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 package org.utgenome.gwt.utgb.client.track.bean;
26
27 import java.util.ArrayList;
28 import java.util.Iterator;
29
30
31
32
33
34
35
36 public class SequenceInfo {
37
38 private String species = "";
39 private ArrayList<String> revisionList = new ArrayList<String>();
40
41 public SequenceInfo() {
42 }
43
44 public SequenceInfo(String species) {
45 this.species = species;
46 }
47
48 public void addRevision(String revision) {
49 this.revisionList.add(revision);
50
51 }
52
53 public String getSpecies() {
54 return species;
55 }
56
57 public void setSpecies(String species) {
58 this.species = species;
59 }
60
61 public ArrayList<String> getRevisionList() {
62 return revisionList;
63 }
64
65 public String toJSON() {
66 StringBuffer buf = new StringBuffer();
67 buf.append("{\"species\":\"");
68 buf.append(species);
69 buf.append("\", \"revision\":[");
70 int count = 0;
71 for (Iterator<String> it = revisionList.iterator(); it.hasNext(); count++) {
72 if (count > 0)
73 buf.append(",");
74 String revision = it.next();
75 buf.append("\"");
76 buf.append(revision);
77 buf.append("\"");
78 }
79 buf.append("]}");
80 return buf.toString();
81 }
82
83 }