@Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof IntsRef) { return this.intsEquals((IntsRef) other); } return false; }
@Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof IntsRef) { return this.intsEquals((IntsRef) other); } return false; }
@Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof IntsRef) { return this.intsEquals((IntsRef) other); } return false; }
@Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof IntsRef) { return this.intsEquals((IntsRef) other); } return false; }
@Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof IntsRef) { return this.intsEquals((IntsRef) other); } return false; }
/** * Perform a traversal of the heap binary tree using recursion. Given a node, * visit its children and check if their subscorer is equivalent to the least * subscorer. If the subscorer is equivalent, it increments the number of * matchers, sum its score with the current score, and recursively visit its * two children. */ private final void computeSumRecursive(final int root) throws IOException { final int i1 = (root << 1); // index of first child node final int i2 = (root << 1) + 1; // index of second child node if (i1 <= size) { final HeapedScorerNode child1 = heap[i1]; if (topHSN.doc == child1.doc && topHSN.node.intsEquals(child1.node)) { nrMatchersInNode++; scoreInNode += child1.scorer.scoreInNode(); this.computeSumRecursive(i1); } } if (i2 <= size) { final HeapedScorerNode child2 = heap[i2]; if (topHSN.doc == child2.doc && topHSN.node.intsEquals(child2.node)) { nrMatchersInNode++; scoreInNode += child2.scorer.scoreInNode(); this.computeSumRecursive(i2); } } }
/** * Perform a traversal of the heap binary tree using recursion. Given a node, * visit its children and check if their subscorer is equivalent to the least * subscorer. If the subscorer is equivalent, it increments the number of * matchers, sum its score with the current score, and recursively visit its * two children. */ private final void computeSumRecursive(final int root) throws IOException { final int i1 = (root << 1); // index of first child node final int i2 = (root << 1) + 1; // index of second child node if (i1 <= size) { final HeapedScorerNode child1 = heap[i1]; if (topHSN.doc == child1.doc && topHSN.node.intsEquals(child1.node)) { nrMatchersInNode++; scoreInNode += child1.scorer.scoreInNode(); this.computeSumRecursive(i1); } } if (i2 <= size) { final HeapedScorerNode child2 = heap[i2]; if (topHSN.doc == child2.doc && topHSN.node.intsEquals(child2.node)) { nrMatchersInNode++; scoreInNode += child2.scorer.scoreInNode(); this.computeSumRecursive(i2); } } }