public Object setValue(Object newValue) { Object oldValue; if (iter != null && iter.isCurrentData(this)) { oldValue = getValue(); iter.set(newValue); } else { if (coll.view.dupsAllowed) { throw new IllegalStateException("May not insert duplicates"); } oldValue = coll.put(getKey(), newValue); } setValueInternal(newValue); return oldValue; }
@Override public AnnotatedNode getAnnotatedNode(ScoringContext c) throws IOException { String type = "score"; String className = this.getClass().getSimpleName(); String parameters = np.toString(); long document = currentCandidate(); boolean atCandidate = hasMatch(c); String returnValue = Double.toString(score(c)); List<AnnotatedNode> children = new ArrayList<>(); for (BaseIterator child : this.iterators) { children.add(child.getAnnotatedNode(c)); } return new AnnotatedNode( type, className, parameters, document, atCandidate, returnValue, children); }