1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
package jalview.fts.core; |
23 |
|
|
24 |
|
import jalview.bin.Cache; |
25 |
|
import jalview.datamodel.SequenceI; |
26 |
|
import jalview.fts.api.FTSDataColumnI; |
27 |
|
|
28 |
|
import java.util.Collection; |
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
@author |
34 |
|
|
35 |
|
|
|
|
| 0% |
Uncovered Elements: 62 (62) |
Complexity: 28 |
Complexity Density: 0.88 |
|
36 |
|
public class FTSRestRequest |
37 |
|
{ |
38 |
|
private String fieldToSearchBy; |
39 |
|
|
40 |
|
private String searchTerm; |
41 |
|
|
42 |
|
private String fieldToSortBy; |
43 |
|
|
44 |
|
private SequenceI associatedSequence; |
45 |
|
|
46 |
|
private boolean allowEmptySequence; |
47 |
|
|
48 |
|
private boolean allowUnpublishedEntries = Cache |
49 |
|
.getDefault("ALLOW_UNPUBLISHED_PDB_QUERYING", false); |
50 |
|
|
51 |
|
private boolean facet; |
52 |
|
|
53 |
|
private String facetPivot; |
54 |
|
|
55 |
|
private int facetPivotMinCount; |
56 |
|
|
57 |
|
private int responseSize; |
58 |
|
|
59 |
|
private int offSet; |
60 |
|
|
61 |
|
private boolean isSortAscending; |
62 |
|
|
63 |
|
private Collection<FTSDataColumnI> wantedFields; |
64 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
65 |
0 |
public String getFieldToSearchBy()... |
66 |
|
{ |
67 |
0 |
return fieldToSearchBy; |
68 |
|
} |
69 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
70 |
0 |
public void setFieldToSearchBy(String fieldToSearchBy)... |
71 |
|
{ |
72 |
0 |
this.fieldToSearchBy = fieldToSearchBy; |
73 |
|
} |
74 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
75 |
0 |
public String getSearchTerm()... |
76 |
|
{ |
77 |
0 |
return searchTerm; |
78 |
|
} |
79 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
80 |
0 |
public void setSearchTerm(String searchTerm)... |
81 |
|
{ |
82 |
0 |
this.searchTerm = searchTerm; |
83 |
|
} |
84 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
85 |
0 |
public boolean isAllowEmptySeq()... |
86 |
|
{ |
87 |
0 |
return allowEmptySequence; |
88 |
|
} |
89 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
0 |
public void setAllowEmptySeq(boolean allowEmptySeq)... |
91 |
|
{ |
92 |
0 |
this.allowEmptySequence = allowEmptySeq; |
93 |
|
} |
94 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
95 |
0 |
public int getResponseSize()... |
96 |
|
{ |
97 |
0 |
return responseSize; |
98 |
|
} |
99 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
0 |
public void setResponseSize(int responseSize)... |
101 |
|
{ |
102 |
0 |
this.responseSize = responseSize; |
103 |
|
} |
104 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
105 |
0 |
public Collection<FTSDataColumnI> getWantedFields()... |
106 |
|
{ |
107 |
0 |
return wantedFields; |
108 |
|
} |
109 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
110 |
0 |
public void setWantedFields(Collection<FTSDataColumnI> wantedFields)... |
111 |
|
{ |
112 |
0 |
this.wantedFields = wantedFields; |
113 |
|
} |
114 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
115 |
0 |
public String getFieldToSortBy()... |
116 |
|
{ |
117 |
0 |
return fieldToSortBy; |
118 |
|
} |
119 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
120 |
0 |
public void setFieldToSortBy(String fieldToSortBy,... |
121 |
|
boolean isSortAscending) |
122 |
|
{ |
123 |
0 |
this.fieldToSortBy = fieldToSortBy; |
124 |
0 |
this.isSortAscending = isSortAscending; |
125 |
|
} |
126 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
127 |
0 |
public boolean isAscending()... |
128 |
|
{ |
129 |
0 |
return isSortAscending; |
130 |
|
} |
131 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
132 |
0 |
public SequenceI getAssociatedSequence()... |
133 |
|
{ |
134 |
0 |
return associatedSequence; |
135 |
|
} |
136 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
137 |
0 |
public void setAssociatedSequence(SequenceI associatedSequence)... |
138 |
|
{ |
139 |
0 |
this.associatedSequence = associatedSequence; |
140 |
|
} |
141 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
142 |
0 |
public boolean isAllowUnpublishedEntries()... |
143 |
|
{ |
144 |
0 |
return allowUnpublishedEntries; |
145 |
|
} |
146 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
147 |
0 |
public void setAllowUnpublishedEntries(boolean allowUnpublishedEntries)... |
148 |
|
{ |
149 |
0 |
this.allowUnpublishedEntries = allowUnpublishedEntries; |
150 |
|
} |
151 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
152 |
0 |
public boolean isFacet()... |
153 |
|
{ |
154 |
0 |
return facet; |
155 |
|
} |
156 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
157 |
0 |
public void setFacet(boolean facet)... |
158 |
|
{ |
159 |
0 |
this.facet = facet; |
160 |
|
} |
161 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
162 |
0 |
public String getFacetPivot()... |
163 |
|
{ |
164 |
0 |
return facetPivot; |
165 |
|
} |
166 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
167 |
0 |
public void setFacetPivot(String facetPivot)... |
168 |
|
{ |
169 |
0 |
this.facetPivot = facetPivot; |
170 |
|
} |
171 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
172 |
0 |
public int getFacetPivotMinCount()... |
173 |
|
{ |
174 |
0 |
return facetPivotMinCount; |
175 |
|
} |
176 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
177 |
0 |
public void setFacetPivotMinCount(int facetPivotMinCount)... |
178 |
|
{ |
179 |
0 |
this.facetPivotMinCount = facetPivotMinCount; |
180 |
|
} |
181 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
182 |
0 |
public int getOffSet()... |
183 |
|
{ |
184 |
0 |
return offSet; |
185 |
|
} |
186 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
187 |
0 |
public void setOffSet(int offSet)... |
188 |
|
{ |
189 |
0 |
this.offSet = offSet; |
190 |
|
} |
191 |
|
|
192 |
|
|
193 |
|
|
194 |
|
|
195 |
|
@param |
196 |
|
|
197 |
|
@return |
198 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
199 |
0 |
public int getFieldIndex(String string)... |
200 |
|
{ |
201 |
0 |
int i = associatedSequence != null ? 1 : 0; |
202 |
0 |
for (FTSDataColumnI field : wantedFields) |
203 |
|
{ |
204 |
0 |
if (field.getName().equals(string)) |
205 |
|
{ |
206 |
0 |
return i; |
207 |
|
} |
208 |
0 |
i++; |
209 |
|
} |
210 |
0 |
return -1; |
211 |
|
} |
212 |
|
} |