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

Method length

src/main/java/gate/Utils.java:75–83  ·  view source on GitHub ↗

Return the length of the document content covered by an Annotation as an int -- if the content is too long for an int, the method will throw a GateRuntimeException. Use getLengthLong(SimpleAnnotation ann) if this situation could occur. @param ann the annotation for which to determine the length @ret

(SimpleAnnotation ann)

Source from the content-addressed store, hash-verified

73 * @return the length of the document content covered by this annotation.
74 */
75 public static int length(SimpleAnnotation ann) {
76 long len = lengthLong(ann);
77 if (len > java.lang.Integer.MAX_VALUE) {
78 throw new GateRuntimeException(
79 "Length of annotation too big to be returned as an int: "+len);
80 } else {
81 return (int)len;
82 }
83 }
84
85 /**
86 * Return the length of the document content covered by an Annotation as a

Callers 12

testGetResourcesMethod · 0.45
shortenUriStringMethod · 0.45
getFileSuffixesMethod · 0.45
getDocumentFormatMethod · 0.45
willReadFromUrlMethod · 0.45
initLocalPathsMethod · 0.45
genSymMethod · 0.45
writeUserConfigMethod · 0.45
createResourceMethod · 0.45

Calls 3

lengthLongMethod · 0.95
sizeMethod · 0.65
getContentMethod · 0.65

Tested by 2

testGetResourcesMethod · 0.36