aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/main/java/com/yahoo/document/annotation/SpanTree.java
diff options
context:
space:
mode:
Diffstat (limited to 'document/src/main/java/com/yahoo/document/annotation/SpanTree.java')
-rw-r--r--document/src/main/java/com/yahoo/document/annotation/SpanTree.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/document/src/main/java/com/yahoo/document/annotation/SpanTree.java b/document/src/main/java/com/yahoo/document/annotation/SpanTree.java
index d63616130e2..f785cf3b3ec 100644
--- a/document/src/main/java/com/yahoo/document/annotation/SpanTree.java
+++ b/document/src/main/java/com/yahoo/document/annotation/SpanTree.java
@@ -1,4 +1,4 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.document.annotation;
import com.google.common.collect.ImmutableMultiset;
@@ -22,7 +22,7 @@ import java.util.Map;
/**
* A SpanTree holds a root node of a tree of SpanNodes, and a List of Annotations pointing to these nodes
- * or each other. It also has a name.
+ * or each other. It also has a name.
*
* @author Einar M R Rosenvinge
* @see com.yahoo.document.annotation.SpanNode
@@ -36,7 +36,7 @@ public class SpanTree implements Iterable<Annotation>, SpanNodeParent, Comparabl
private StringFieldValue stringFieldValue;
/**
- * WARNING!&nbsp;Only to be used by deserializers!&nbsp;Creates an empty SpanTree instance.
+ * WARNING! Only to be used by deserializers! Creates an empty SpanTree instance.
*/
public SpanTree() { }
@@ -65,8 +65,8 @@ public class SpanTree implements Iterable<Annotation>, SpanNodeParent, Comparabl
public SpanTree(SpanTree otherToCopy) {
name = otherToCopy.name;
setRoot(copySpan(otherToCopy.root));
- List<Annotation> annotationsToCopy = new ArrayList<Annotation>(otherToCopy.getAnnotations());
- List<Annotation> newAnnotations = new ArrayList<Annotation>(annotationsToCopy.size());
+ List<Annotation> annotationsToCopy = new ArrayList<>(otherToCopy.getAnnotations());
+ List<Annotation> newAnnotations = new ArrayList<>(annotationsToCopy.size());
for (Annotation otherAnnotationToCopy : annotationsToCopy) {
newAnnotations.add(new Annotation(otherAnnotationToCopy));
@@ -153,7 +153,7 @@ public class SpanTree implements Iterable<Annotation>, SpanNodeParent, Comparabl
}
private IdentityHashMap<Annotation, Integer> getAnnotations(List<Annotation> annotationsToCopy) {
- IdentityHashMap<Annotation, Integer> map = new IdentityHashMap<Annotation, Integer>();
+ IdentityHashMap<Annotation, Integer> map = new IdentityHashMap<>();
for (int i = 0; i < annotationsToCopy.size(); i++) {
map.put(annotationsToCopy.get(i), i);
}
@@ -162,7 +162,7 @@ public class SpanTree implements Iterable<Annotation>, SpanNodeParent, Comparabl
private List<SpanNode> getSpanNodes() {
- ArrayList<SpanNode> nodes = new ArrayList<SpanNode>();
+ ArrayList<SpanNode> nodes = new ArrayList<>();
nodes.add(root);
Iterator<SpanNode> it = root.childIteratorRecursive();
while (it.hasNext()) {
@@ -172,7 +172,7 @@ public class SpanTree implements Iterable<Annotation>, SpanNodeParent, Comparabl
}
private static IdentityHashMap<SpanNode, Integer> getSpanNodes(SpanTree otherToCopy) {
- IdentityHashMap<SpanNode, Integer> map = new IdentityHashMap<SpanNode, Integer>();
+ IdentityHashMap<SpanNode, Integer> map = new IdentityHashMap<>();
int spanNodeCounter = 0;
map.put(otherToCopy.getRoot(), spanNodeCounter++);
Iterator<SpanNode> it = otherToCopy.getRoot().childIteratorRecursive();