- Timestamp:
- 10/28/14 13:42:26 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUClient/trunk/src/main/java/eu/clarin/sru/client/fcs/DataViewHits.java
r5743 r5749 1 1 package eu.clarin.sru.client.fcs; 2 2 3 /** 4 * A Data View implementation that stores the content of a HITS Data View. 5 */ 3 6 public class DataViewHits extends DataView { 4 7 /** … … 55 58 56 59 60 /** 61 * Get the total number of hits in the result. 62 * @return the number of hits 63 */ 57 64 public int getHitCount() { 58 65 return max_offset; … … 60 67 61 68 69 /** 70 * Get the text content of the hit. Usually this is complete sentence. 71 * 72 * @return the text content of the hit 73 */ 62 74 public String getText() { 63 75 return text; … … 65 77 66 78 79 /** 80 * Get the offsets pointing to range in the text content that yield the hit. 81 * 82 * @param idx 83 * the hit to retrieve. Must be larger than <code>0</code> and 84 * smaller than the result of {@link #getHitCount()}. 85 * @return An array of two elements. The first array element is the start 86 * offset, the second array element is the end offset of the hit 87 * range. 88 * @throws ArrayIndexOutOfBoundsException 89 * of the <code>idx</code> argument is out of bounds. 90 */ 67 91 public int[] getHitOffsets(int idx) { 68 92 if (idx < 0) { 69 throw new IllegalArgumentException("idx < 0");93 throw new ArrayIndexOutOfBoundsException("idx < 0"); 70 94 } 71 95 if (idx < max_offset) {
Note: See TracChangeset
for help on using the changeset viewer.