MCPcopy Create free account
hub / github.com/GateNLP/gate-core / isValidOffset

Method isValidOffset

src/main/java/gate/corpora/DocumentImpl.java:2157–2162  ·  view source on GitHub ↗

Check that an offset is valid, i.e. it is non-null, greater than or equal to 0 and less than the size of the document content.

(Long offset)

Source from the content-addressed store, hash-verified

2155 * to 0 and less than the size of the document content.
2156 */
2157 public boolean isValidOffset(Long offset) {
2158 if(offset == null) return false;
2159 long o = offset.longValue();
2160 if(o > getContent().size().longValue() || o < 0) return false;
2161 return true;
2162 } // isValidOffset
2163
2164 /**
2165 * Check that both start and end are valid offsets and that they constitute a

Callers 1

isValidOffsetRangeMethod · 0.95

Calls 2

getContentMethod · 0.95
sizeMethod · 0.65

Tested by

no test coverage detected