@Override public boolean isEmpty() { return original.isEmpty(); }
@Override public boolean isEmpty() { return second.isEmpty(); }
@Override public boolean isEmpty() { return first.isEmpty(); }
@Override public boolean isEmpty() { return rows.isEmpty(); }
@Override public boolean isEmpty() { return rows.isEmpty(); }
@Override public boolean isEmpty() { return original.isEmpty(); }
@Override public boolean isEmpty() { return delegate.isEmpty(); }
@Override public boolean isEmpty() { return delegate.isEmpty(); }
@Override public boolean isEmpty() { return second.isEmpty(); }
@Override public boolean isEmpty() { return first.isEmpty(); }
@Override public boolean isEmpty() { initialize(); return dependentQuery.isEmpty(); }
@Override public boolean isEmpty() { if (left.isEmpty()) { if (useNonMatchingRightRows() || useAllRightRowsWhenNoLeftRows()) { // Even if the left is empty, we still need to use the right rows ... return delegate.isEmpty(); } // Left is empty, but we always have to have a left and don't care about the right ... return true; } else if (delegate.isEmpty()) { if (useAllLeftRowsWhenNoMatchingRightRows()) { // There are no right rows, but we still need to use all the rows on the left ... assert !left.isEmpty(); return false; } } return false; }
@Override public boolean isEmpty() { initialize(); return dependentQuery.isEmpty(); }
@Override public boolean isEmpty() { if (left.isEmpty()) { if (useNonMatchingRightRows() || useAllRightRowsWhenNoLeftRows()) { // Even if the left is empty, we still need to use the right rows ... return delegate.isEmpty(); } // Left is empty, but we always have to have a left and don't care about the right ... return true; } else if (delegate.isEmpty()) { if (useAllLeftRowsWhenNoMatchingRightRows()) { // There are no right rows, but we still need to use all the rows on the left ... assert !left.isEmpty(); return false; } } return false; }
@Override public RowIterator getRows() throws RepositoryException { if (accessed) { if (restartable) { if (sequence instanceof Restartable) { ((Restartable)sequence).restart(); } else { assert sequence.isEmpty(); } } else if (!sequence.isEmpty()) { throw new RepositoryException(JcrI18n.multipleCallsToGetRowsOrNodesIsNotAllowed.text(queryStatement)); } } accessed = true; final Columns columns = results.getColumns(); if (columns.getSelectorNames().size() == 1) { // Then we know that there is only one selector in the results ... return new SingleSelectorQueryResultRowIterator(context, queryStatement, sequence, columns); } // There may be 1 or more selectors in the columns, but the results definitely have more than one selector ... return new QueryResultRowIterator(context, queryStatement, sequence, results.getColumns()); }
@Override public RowIterator getRows() throws RepositoryException { if (accessed) { if (restartable) { if (sequence instanceof Restartable) { ((Restartable)sequence).restart(); } else { assert sequence.isEmpty(); } } else if (!sequence.isEmpty()) { throw new RepositoryException(JcrI18n.multipleCallsToGetRowsOrNodesIsNotAllowed.text(queryStatement)); } } accessed = true; final Columns columns = results.getColumns(); if (columns.getSelectorNames().size() == 1) { // Then we know that there is only one selector in the results ... return new SingleSelectorQueryResultRowIterator(context, queryStatement, sequence, columns); } // There may be 1 or more selectors in the columns, but the results definitely have more than one selector ... return new QueryResultRowIterator(context, queryStatement, sequence, results.getColumns()); }
@Override public NodeIterator getNodes() throws RepositoryException { if (accessed) { if (restartable) { if (sequence instanceof Restartable) { ((Restartable)sequence).restart(); } else { assert sequence.isEmpty(); } } else if (!sequence.isEmpty()) { throw new RepositoryException(JcrI18n.multipleCallsToGetRowsOrNodesIsNotAllowed.text(queryStatement)); } } if (getSelectorNames().length > 1) { throw new RepositoryException(JcrI18n.multipleSelectorsAppearInQueryUnableToCallMethod.text(queryStatement)); } // Find all of the nodes in the results... accessed = true; int defaultSelectorIndex = computeDefaultSelectorIndex(); return new QueryResultNodeIterator(context, sequence, defaultSelectorIndex); }
@Override public NodeIterator getNodes() throws RepositoryException { if (accessed) { if (restartable) { if (sequence instanceof Restartable) { ((Restartable)sequence).restart(); } else { assert sequence.isEmpty(); } } else if (!sequence.isEmpty()) { throw new RepositoryException(JcrI18n.multipleCallsToGetRowsOrNodesIsNotAllowed.text(queryStatement)); } } if (getSelectorNames().length > 1) { throw new RepositoryException(JcrI18n.multipleSelectorsAppearInQueryUnableToCallMethod.text(queryStatement)); } // Find all of the nodes in the results... accessed = true; int defaultSelectorIndex = computeDefaultSelectorIndex(); return new QueryResultNodeIterator(context, sequence, defaultSelectorIndex); }
@SuppressWarnings( "unchecked" ) public CountableSequence( String workspaceName, NodeSequence original, BufferManager bufferMgr, CachedNodeSupplier nodeCache, boolean useHeap ) { this.original = original; this.workspaceName = workspaceName; this.width = original.width(); assert !original.isEmpty(); assert original.getRowCount() == -1; assert original.width() != 0; // Create the row factory ... this.rowFactory = BufferedRows.serializer(nodeCache, width); // Create the buffer into which we'll place the rows with null keys ... Serializer<BufferedRow> rowSerializer = (Serializer<BufferedRow>)BufferedRows.serializer(nodeCache, width); buffer = bufferMgr.createQueueBuffer(rowSerializer).useHeap(useHeap).make(); }
@SuppressWarnings( "unchecked" ) public CountableSequence( String workspaceName, NodeSequence original, BufferManager bufferMgr, CachedNodeSupplier nodeCache, boolean useHeap ) { this.original = original; this.workspaceName = workspaceName; this.width = original.width(); assert !original.isEmpty(); assert original.getRowCount() == -1; assert original.width() != 0; // Create the row factory ... this.rowFactory = BufferedRows.serializer(nodeCache, width); // Create the buffer into which we'll place the rows with null keys ... Serializer<BufferedRow> rowSerializer = (Serializer<BufferedRow>)BufferedRows.serializer(nodeCache, width); buffer = bufferMgr.createQueueBuffer(rowSerializer).useHeap(useHeap).make(); }