projectedFieldsSet = new ImmutableSet.Builder<FieldPath>() .addAll(scannedFieldsSet).build();
private static <V> ImmutableSet.Builder<V> valuesBuilder( @Nullable Comparator<? super V> valueComparator) { return (valueComparator == null) ? new ImmutableSet.Builder<V>() : new ImmutableSortedSet.Builder<V>(valueComparator); }
/** * Returns an immutable set containing each of {@code elements}, minus duplicates, in the order * each appears first in the source iterator. * * @throws NullPointerException if any of {@code elements} is null */ public static <E> ImmutableSet<E> copyOf(Iterator<? extends E> elements) { // We special-case for 0 or 1 elements, but anything further is madness. if (!elements.hasNext()) { return of(); } E first = elements.next(); if (!elements.hasNext()) { return of(first); } else { return new ImmutableSet.Builder<E>().add(first).addAll(elements).build(); } }
projectedFieldsSet = new ImmutableSet.Builder<FieldPath>() .addAll(scannedFieldsSet).build();
public MapRDBIndexDescriptor(List<LogicalExpression> indexCols, CollationContext indexCollationContext, List<LogicalExpression> nonIndexCols, List<LogicalExpression> rowKeyColumns, String indexName, String tableName, IndexType type, Object desc, DbGroupScan scan, NullDirection nullsDirection) { super(indexCols, indexCollationContext, nonIndexCols, rowKeyColumns, indexName, tableName, type, nullsDirection); this.desc = desc; this.indexedFields = ImmutableSet.copyOf(indexColumns); this.allFields = new ImmutableSet.Builder<LogicalExpression>() .add(PluginConstants.DOCUMENT_SCHEMA_PATH) .addAll(indexColumns) .addAll(nonIndexColumns) .build(); this.pluginCost = scan.getPluginCostModel(); }
/** * Returns a new builder. The generated builder is equivalent to the builder * created by the {@link Builder} constructor. */ public static <E> Builder<E> builder() { return new Builder<E>(); }
@Override public ImmutableSet<E> immutableCopy() { return new ImmutableSet.Builder<E>().addAll(set1).addAll(set2).build(); } };
public MapRDBIndexDescriptor(List<LogicalExpression> indexCols, CollationContext indexCollationContext, List<LogicalExpression> nonIndexCols, List<LogicalExpression> rowKeyColumns, String indexName, String tableName, IndexType type, Object desc, DbGroupScan scan, NullDirection nullsDirection) { super(indexCols, indexCollationContext, nonIndexCols, rowKeyColumns, indexName, tableName, type, nullsDirection); this.desc = desc; this.indexedFields = ImmutableSet.copyOf(indexColumns); this.allFields = new ImmutableSet.Builder<LogicalExpression>() .add(PluginConstants.DOCUMENT_SCHEMA_PATH) .addAll(indexColumns) .addAll(nonIndexColumns) .build(); this.pluginCost = scan.getPluginCostModel(); }