Same effect as {@link Iterate#count(Iterable, Predicate)}, but executed in parallel batches.

@return The number of elements which satisfy the predicate.
9045
public static <T> int count(Iterable<T> iterable, Predicate<? super T> predicate, int batchSize, Executor executor)
    {
        CountCombiner<T> combiner = new CountCombiner<T>();
        CountProcedureFactory<T> procedureFactory = new CountProcedureFactory<T>(predicate);
        ParallelIterate.forEach(
                iterable,
                procedureFactory,
                combiner,
                batchSize,
                executor);
        return combiner.getCount();
    }
1328440
public int getNumberOfPredecessors() {

		int numberOfPredecessors = 0;

		for (int i = 0; i < this.inputGates.length; ++i) {
			numberOfPredecessors += this.inputGates[i].getNumberOfEdges();
		}

		return numberOfPredecessors;
	}
1242569
public static <T, IV> int countWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super IV> predicate,
            IV injectedValue)
    {
        if (iterable instanceof MutableCollection)
        {
            return ((MutableCollection<T>) iterable).countWith(predicate, injectedValue);
        }
        if (iterable instanceof ArrayList)
        {
            return ArrayListIterate.countWith((ArrayList<T>) iterable, predicate, injectedValue);
        }
        if (iterable instanceof List)
        {
            return ListIterate.countWith((List<T>) iterable, predicate, injectedValue);
        }
        if (iterable != null)
        {
            return IterableIterate.countWith(iterable, predicate, injectedValue);
        }
        throw new IllegalArgumentException("Cannot get a count from null");
    }
1188726
public function count()
    {
        $traversable = $this->optimizeUnwrap();

        if (is_array($traversable)) {
            return count($traversable);
        }

        return iterator_count($traversable);
    }
698454
public CountQueryResult executeCount() {
		CountQueryResult ret = new CountQueryResult(this);
		Object so = this.queryExecutor.getMappingInfo().getInternalDomainAccess().getSyncObject();
		if (so != null) {
			synchronized (so) {
				this.queryExecutor.executeCount();
			}
		} else
			this.queryExecutor.executeCount();
		return ret;
	}
841524
public static <E> E nth(long count, Iterable<E> iterable) {
        dbc.precondition(iterable != null, "cannot call nth with a null iterable");
        final Iterator<E> filtered = new FilteringIterator<E>(iterable.iterator(), new Nth<E>(count));
        return new FirstElement<E>().apply(filtered);
    }
1223745
@VisibleForTesting
    public int getCurrentTaskCount() {
        synchronized (this.queue) {
            int size = this.queue.size() + this.filterQueue.size();
            if (size > 0) {
                // Some tasks may have completed, but we haven't yet been able to clean them up.
                size -= this.queue.values().stream().filter(CompletableFuture::isDone).count();
                size -= this.filterQueue.values().stream().filter(CompletableFuture::isDone).count();
            }

            return size;
        }
    }
732591
public static <T> int count(Iterable<T> iterable, Matcher<T> matcher) {
		int count = 0;
		if (null != iterable) {
			for (T t : iterable) {
				if (null == matcher || matcher.match(t)) {
					count++;
				}
			}
		}
		return count;
	}
951458
@Override
	public int count() {
		try (Stream<?> paramStream = stream) {
			int count = paramStream.map(r -> {
				Map<String, Object> m = toMap(r);
				paramMap(m);
				context().addBatch();
				return condition.test(context(), m) ? executeBatch() : 0;
			}).reduce(0, (joined, element) -> joined + element);
			return count + (context().batchCount() != 0 ? executeBatch() : 0);
		} finally {
			stream = null;
			condition = DEFAULT_BATCH_WHEN_CONDITION;
			batchAction = DEFAULT_BATCH_ACTION;
			errorAction = DEFAULT_ERROR_ACTION;
		}
	}
1005592
public static Predicates<Object> in(Iterable<?> iterable)
    {
        if (iterable instanceof SetIterable<?>)
        {
            return new InSetIterablePredicate((SetIterable<?>) iterable);
        }
        if (iterable instanceof Set<?>)
        {
            return new InSetPredicate((Set<?>) iterable);
        }
        if (iterable instanceof Collection<?> && ((Collection<?>) iterable).size() <= SMALL_COLLECTION_THRESHOLD)
        {
            return new InCollectionPredicate((Collection<?>) iterable);
        }
        return new InSetIterablePredicate(UnifiedSet.newSet(iterable));
    }
222800
public static <E> int counti(Iterable<E> iterable) {
        dbc.precondition(iterable != null, "cannot call counti with a null iterable");
        return counti(iterable.iterator());
    }
649990
public static int count(Iterable it) {
        int n = 0;

        for(Object v: it) {
            if(v != null) {
                ++n;
            }
        }

        return n;
    }
579702
public static <T, P> int detectIndexWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super P> predicate,
            P parameter)
    {
        if (iterable instanceof ArrayList<?>)
        {
            return ArrayListIterate.detectIndexWith((ArrayList<T>) iterable, predicate, parameter);
        }
        if (iterable instanceof List<?>)
        {
            return ListIterate.detectIndexWith((List<T>) iterable, predicate, parameter);
        }
        if (iterable != null)
        {
            return IterableIterate.detectIndexWith(iterable, predicate, parameter);
        }
        throw new IllegalArgumentException("Cannot perform detectIndexWith on null");
    }
452258
public static <E> int iterableSize(Iterable<E> itrbl) {
	int size = 0;
	for (Iterator<E> iter = itrbl.iterator(); iter.hasNext();) {
		iter.next();
		size++;
	}
	return size;
    }
213035
public long count() throws Exception {
		final String id = new AbstractID().toString();

		output(new Utils.CountHelper<T>(id)).name("count()");

		JobExecutionResult res = getExecutionEnvironment().execute();
		return res.<Long> getAccumulatorResult(id);
	}
457588
public static <T> ObjIterator<T> limit(final Iterator<T> iter, final long count) {
        N.checkArgNotNegative(count, "count");

        if (iter == null || count == 0) {
            return ObjIterator.empty();
        }

        return new ObjIterator<T>() {
            private long cnt = count;

            @Override
            public boolean hasNext() {
                return cnt > 0 && iter.hasNext();
            }

            @Override
            public T next() {
                if (hasNext() == false) {
                    throw new NoSuchElementException();
                }

                cnt--;
                return iter.next();
            }
        };
    }
1266271
@Override
    public int rowCount() {
        int result = 0;
        if (!columnList.isEmpty()) {
            // all the columns have the same number of elements, so we can check any of them
            result = columnList.get(0).size();
        }
        return result;
    }