Changeset 7190
- Timestamp:
- 10/11/18 11:35:43 (6 years ago)
- Location:
- SRUClient/trunk/src/main/java/eu/clarin/sru/client
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUAbstractResponse.java
r7077 r7190 125 125 126 126 /** 127 * Get the number of diagnostics in the response. 128 * 129 * <p> 130 * NB: Surrogate diagnostics are not covered by this. 131 * </p> 132 * 133 * @return the number of diagnostics or <code>0</code> is none 134 */ 135 public int getDiagnosticsCount() { 136 return (diagnostics != null) ? diagnostics.size() : 0; 137 } 138 139 140 /** 127 141 * Get the extra response data for this result. 128 142 * … … 137 151 138 152 /** 139 * Check, if this response has any extra response data attached to it. 153 * Check, if this response has any extra response data attached to the 154 * response. 140 155 * 141 156 * @return <code>true</code> if extra response is attached, … … 147 162 148 163 164 /** 165 * Return the number of extra response data records attached to the 166 * response. 167 * 168 * @return the number of records, or <code>0</code> is none 169 */ 170 public int getExtraResponseDataCount() { 171 return (extraResponseData != null) ? extraResponseData.size() : 0; 172 } 173 174 149 175 /** 150 176 * Get the extra response data of a specific class for this result. … … 155 181 * the type of {@link SRUExtraResponseData} to check for 156 182 * 157 * @return a {@link SRUExtraResponseData} instances for the183 * @return a list of {@link SRUExtraResponseData} instances for the 158 184 * extra response data from the SRU response or <code>null</code> if 159 185 * none are available … … 165 191 } 166 192 List<V> result = null; 167 for (SRUExtraResponseData i : extraResponseData) { 168 if (clazz.isInstance(i)) { 169 if (result == null) { 170 result = new ArrayList<V>(); 193 if (extraResponseData != null) { 194 for (SRUExtraResponseData i : extraResponseData) { 195 if (clazz.isInstance(i)) { 196 if (result == null) { 197 result = new ArrayList<V>(); 198 } 199 result.add(clazz.cast(i)); 171 200 } 172 result.add(clazz.cast(i));173 201 } 174 202 } -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUScanResponse.java
r6938 r7190 67 67 } 68 68 69 70 /** 71 * Get the number of terms returned by the request. 72 * 73 * @return the number of terms or <code>0</code> if none 74 */ 75 public int getTermsCount() { 76 return (terms != null) ? terms.size() : 0; 77 } 78 69 79 } // class SRUScanResponse -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUSearchRetrieveResponse.java
r6938 r7190 111 111 112 112 /** 113 * Get the number of records returned by the request. 114 * 115 * @return number of records or <code>0</code> if none 116 */ 117 public int getRecordsCount() { 118 return (records != null) ? records.size() : 0; 119 } 120 121 122 /** 113 123 * Get the next record position. 114 124 *
Note: See TracChangeset
for help on using the changeset viewer.