@Override protected void addRow( Batch batch ) { for (int i = 0; i != width(); ++i) { nodes.add(batch.getNode(i)); scores.add(batch.getScore(i)); } }
@Override protected void addRow( Batch batch ) { for (int i = 0; i != width(); ++i) { nodes.add(batch.getNode(i)); scores.add(batch.getScore(i)); } }
@Override public CachedNode getNode( int index ) { if (index > 0 && index < firstWidth) { return batch1 != null ? batch1.getNode(index) : null; } else if (index >= firstWidth && index < totalWidth) { return batch2 != null ? batch2.getNode(index - firstWidth) : null; } throw new IndexOutOfBoundsException(); }
@Override public boolean isCurrentRowValid( Batch batch ) { CachedNode node = batch.getNode(index); return node != null && node.hasProperty(propertyName, cache); }
@Override public boolean isCurrentRowValid( Batch batch ) { CachedNode node = batch.getNode(index); while (node != null) { NodeKey parentKey = node.getParentKey(cache); if (parentKey == null) return false; if (ancestorKey.equals(parentKey)) return true; // Don't have to check the additional parents since we only find shared nodes in the original location ... node = cache.getNode(parentKey); } return false; }
@Override public Node getNode( String selectorName ) throws RepositoryException { int nodeIndex = iterator.nodeIndexForSelector(selectorName); if (nodeIndex < 0) { throw new RepositoryException(JcrI18n.selectorNotUsedInQuery.text(selectorName, iterator.query)); } CachedNode cachedNode = batchAtRow.getNode(nodeIndex); return cachedNode == null ? null : iterator.context.getNode(cachedNode); }
@Override public CachedNode getNode( int index ) { if (index < leftWidth) return null; return right.getNode(index - leftWidth); }
@Override public CachedNode getNode( int index ) { assert index == 0; return original.getNode(selectorIndexes[index]); }
@Override public Value getValue( String columnName ) throws ItemNotFoundException, RepositoryException { String selectorName = iterator.columns.getSelectorNameForColumnName(columnName); int nodeIndex = iterator.columns.getSelectorIndex(selectorName); if (nodeIndex == -1) { throw new RepositoryException(JcrI18n.queryResultsDoNotIncludeColumn.text(columnName, iterator.query)); } CachedNode cachedNode = batchAtRow.getNode(nodeIndex); return getValue(columnName, cachedNode, nodeIndex); } }
@Override public Value getValue( String columnName ) throws ItemNotFoundException, RepositoryException { String selectorName = iterator.columns.getSelectorNameForColumnName(columnName); int nodeIndex = iterator.columns.getSelectorIndex(selectorName); if (nodeIndex == -1) { throw new RepositoryException(JcrI18n.queryResultsDoNotIncludeColumn.text(columnName, iterator.query)); } CachedNode cachedNode = batchAtRow.getNode(nodeIndex); return getValue(columnName, cachedNode, nodeIndex); } }
@Override public CachedNode getNode( int index ) { assert index == 0; return original.getNode(selectorIndexes[index]); }
@Override public boolean isCurrentRowValid( Batch batch ) { CachedNode node = batch.getNode(); return context.canRead(node); } });
protected SingleSelectorQueryResultRow( QueryResultRowIterator iterator, Batch batchAtRow, int selectorIndex ) { super(iterator, batchAtRow); this.selectorIndex = selectorIndex; this.cachedNode = batchAtRow.getNode(selectorIndex); this.node = iterator.context.getNode(cachedNode); }
@Override public boolean isCurrentRowValid( Batch batch ) { CachedNode node = batch.getNode(index); return node != null && node.hasProperty(propertyName, cache); }
@Override public boolean isCurrentRowValid( Batch batch ) { CachedNode node = batch.getNode(indexInRow); if (node == null) return true; return node.getKey().getWorkspaceKey().equals(workspaceKey); } };
protected SingleSelectorQueryResultRow( QueryResultRowIterator iterator, Batch batchAtRow, int selectorIndex ) { super(iterator, batchAtRow); this.selectorIndex = selectorIndex; this.cachedNode = batchAtRow.getNode(selectorIndex); this.node = iterator.context.getNode(cachedNode); }
@Override public Node getNode( String selectorName ) throws RepositoryException { int nodeIndex = iterator.nodeIndexForSelector(selectorName); if (nodeIndex < 0) { throw new RepositoryException(JcrI18n.selectorNotUsedInQuery.text(selectorName, iterator.query)); } CachedNode cachedNode = batchAtRow.getNode(nodeIndex); return cachedNode == null ? null : iterator.context.getNode(cachedNode); }
@Override public boolean isCurrentRowValid( Batch batch ) { CachedNode node = batch.getNode(index); if (node == null) return false; if (isParentRoot) return true; if (parentKey.equals(node.getParentKey(cache))) return true; // Don't have to check the additional parents since we only find shared nodes in the original location ... return false; }
@Override public MultiNodeRow createRow( Batch currentRow ) { CachedNode[] nodes = new CachedNode[width]; float[] scores = new float[width]; for (int i = 0; i != width; ++i) { nodes[i] = currentRow.getNode(i); scores[i] = currentRow.getScore(i); } return new MultiNodeRow(nodes, scores); }