aboutsummaryrefslogtreecommitdiffstats
path: root/node-admin
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@yahooinc.com>2022-01-11 18:06:31 +0100
committerHåkon Hallingstad <hakon@yahooinc.com>2022-01-11 18:06:31 +0100
commitaa9682ca8cc0ceea89766549a6cf0ca548749b3a (patch)
treebdf6c03e3e7d8e2a39cf9219d83b40731afc32b8 /node-admin
parent193f0db32bc5304fe34eec50c7b551226da184a5 (diff)
Fix javadoc for Cursor::skip
Diffstat (limited to 'node-admin')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/text/Cursor.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/text/Cursor.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/text/Cursor.java
index 277c16b9e71..2fc3f8bac60 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/text/Cursor.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/text/Cursor.java
@@ -29,18 +29,19 @@ public class Cursor {
@Override
public String toString() { return text.substring(offset); }
+ public String fullText() { return text; }
public int offset() { return offset; }
public boolean bot() { return offset == 0; }
public boolean eot() { return offset == text.length(); }
public boolean startsWith(char c) { return offset < text.length() && text.charAt(offset) == c; }
public boolean startsWith(String prefix) { return text.startsWith(prefix, offset); }
+
+ /** @throws IndexOutOfBoundsException if {@link #eot()}. */
public char getChar() { return text.charAt(offset); }
/** The number of chars between pointer and EOT. */
public int length() { return text.length() - offset; }
- public String fullText() { return text; }
-
/** Calculate the current text location in O(length(text)). */
public TextLocation calculateLocation() {
if (offset < locationCache.offset()) {
@@ -72,7 +73,7 @@ public class Cursor {
this.offset = that.offset;
}
- /** If the next substring.length() chars of matches substring pointing at Advance pointer past substring if pointer Returns true if pointing at string. */
+ /** Advance substring.length() if this startsWith the substring, returning true if so. */
public boolean skip(String substring) {
if (startsWith(substring)) {
offset += substring.length();
@@ -161,6 +162,4 @@ public class Cursor {
public int hashCode() {
return Objects.hash(text, offset);
}
-
- private void throwIfEot() { if (eot()) throw new StringIndexOutOfBoundsException(offset); }
}