{@inheritDoc}

<p>This implementation simply counts the elements in the interator.
481432
@Override
    public int size ()
    {
        // dumb implementation. You should override.
        int size = 0;
        for (Interator it = interator(); (size < Integer.MAX_VALUE) && it.hasNext(); it.nextInt()) {
            size++;
        }
        return size;
    }
187717
public void setCount(Integer count) {
        if (count == null)
            throw new RuntimeException("Cannot set count to null. Call removeCount() if you wanted to remove the bubble");

        if (countElem == null)
            createAndAttachCountElement();
        countElem.setInnerText(count.toString());
    }
106729
def element_count(self):
        
        result = conf.lib.clang_getNumElements(self)
        if result < 0:
            raise Exception('Type does not have elements.')

        return result
214051
protected int countComponentContainPaxWicketBeanAnnotatedFieldsHierachical(Class<?> component) {
        Class<?> clazz = component;
        int numberOfInjectionFields = 0;
        while (clazz != null && !isBoundaryClass(clazz)) {
            for (Field field : clazz.getDeclaredFields()) {
                if (field.isAnnotationPresent(Inject.class)) {
                    numberOfInjectionFields++;
                }
            }
            clazz = clazz.getSuperclass();
        }
        return numberOfInjectionFields;
    }
599013
private static <E> void loadIntoCounter(String filename, Class<E> c, Counter<E> counter) throws RuntimeException {
    try {
      Constructor<E> m = c.getConstructor(String.class);
      BufferedReader in = IOUtils.getBufferedFileReader(filename);// new
                                                                  // BufferedReader(new
                                                                  // FileReader(filename));
      String line = in.readLine();
      while (line != null && line.length() > 0) {
        int endPos = Math.max(line.lastIndexOf(' '), line.lastIndexOf('\t'));

        counter.setCount(m.newInstance(line.substring(0, endPos).trim()), Double.parseDouble(line.substring(endPos, line.length()).trim()));

        line = in.readLine();
      }
      in.close();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
867067
private void countDescendants() throws TTIOException {
        long descendants = 1;
        final long nodeKey = mRtx.getNode().getDataKey();
        if (((ITreeStructData)mRtx.getNode()).hasFirstChild()) {
            mRtx.moveTo(((ITreeStructData)mRtx.getNode()).getFirstChildKey());
            do {
                descendants += mDescendants.get(mRtx.getNode());
            } while (((ITreeStructData)mRtx.getNode()).hasRightSibling()
                && mRtx.moveTo(((ITreeStructData)mRtx.getNode()).getRightSiblingKey()));
        }
        mRtx.moveTo(nodeKey);
        mDescendants.put(mRtx.getNode(), descendants);
    }
368225
@Override
	public int countAll() {
		Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY, this);

		if (count == null) {
			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(_SQL_COUNT_CPDEFINITIONLOCALIZATION);

				count = (Long)q.uniqueResult();

				finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
					count);
			}
			catch (Exception e) {
				finderCache.removeResult(FINDER_PATH_COUNT_ALL,
					FINDER_ARGS_EMPTY);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return count.intValue();
	}
652472
public static <E> Counter<E> asCounter(Collection<E> c) {
    Counter<E> count = new ClassicCounter<E>();
    for (E elem : c) {
      count.incrementCount(elem);
    }
    return count;
  }
266265
private static void countElements(byte[] fp, IAtomContainer mol) {
        int b;
        CountElements ce = new CountElements(mol);

        b = 0;
        if (ce.getCount("H") >= 4) fp[b >> 3] |= MASK[b % 8];
        b = 1;
        if (ce.getCount("H") >= 8) fp[b >> 3] |= MASK[b % 8];
        b = 2;
        if (ce.getCount("H") >= 16) fp[b >> 3] |= MASK[b % 8];
        b = 3;
        if (ce.getCount("H") >= 32) fp[b >> 3] |= MASK[b % 8];
        b = 4;
        if (ce.getCount("Li") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 5;
        if (ce.getCount("Li") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 6;
        if (ce.getCount("B") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 7;
        if (ce.getCount("B") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 8;
        if (ce.getCount("B") >= 4) fp[b >> 3] |= MASK[b % 8];
        b = 9;
        if (ce.getCount("C") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 10;
        if (ce.getCount("C") >= 4) fp[b >> 3] |= MASK[b % 8];
        b = 11;
        if (ce.getCount("C") >= 8) fp[b >> 3] |= MASK[b % 8];
        b = 12;
        if (ce.getCount("C") >= 16) fp[b >> 3] |= MASK[b % 8];
        b = 13;
        if (ce.getCount("C") >= 32) fp[b >> 3] |= MASK[b % 8];
        b = 14;
        if (ce.getCount("N") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 15;
        if (ce.getCount("N") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 16;
        if (ce.getCount("N") >= 4) fp[b >> 3] |= MASK[b % 8];
        b = 17;
        if (ce.getCount("N") >= 8) fp[b >> 3] |= MASK[b % 8];
        b = 18;
        if (ce.getCount("O") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 19;
        if (ce.getCount("O") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 20;
        if (ce.getCount("O") >= 4) fp[b >> 3] |= MASK[b % 8];
        b = 21;
        if (ce.getCount("O") >= 8) fp[b >> 3] |= MASK[b % 8];
        b = 22;
        if (ce.getCount("O") >= 16) fp[b >> 3] |= MASK[b % 8];
        b = 23;
        if (ce.getCount("F") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 24;
        if (ce.getCount("F") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 25;
        if (ce.getCount("F") >= 4) fp[b >> 3] |= MASK[b % 8];
        b = 26;
        if (ce.getCount("Na") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 27;
        if (ce.getCount("Na") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 28;
        if (ce.getCount("Si") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 29;
        if (ce.getCount("Si") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 30;
        if (ce.getCount("P") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 31;
        if (ce.getCount("P") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 32;
        if (ce.getCount("P") >= 4) fp[b >> 3] |= MASK[b % 8];
        b = 33;
        if (ce.getCount("S") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 34;
        if (ce.getCount("S") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 35;
        if (ce.getCount("S") >= 4) fp[b >> 3] |= MASK[b % 8];
        b = 36;
        if (ce.getCount("S") >= 8) fp[b >> 3] |= MASK[b % 8];
        b = 37;
        if (ce.getCount("Cl") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 38;
        if (ce.getCount("Cl") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 39;
        if (ce.getCount("Cl") >= 4) fp[b >> 3] |= MASK[b % 8];
        b = 40;
        if (ce.getCount("Cl") >= 8) fp[b >> 3] |= MASK[b % 8];
        b = 41;
        if (ce.getCount("K") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 42;
        if (ce.getCount("K") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 43;
        if (ce.getCount("Br") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 44;
        if (ce.getCount("Br") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 45;
        if (ce.getCount("Br") >= 4) fp[b >> 3] |= MASK[b % 8];
        b = 46;
        if (ce.getCount("I") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 47;
        if (ce.getCount("I") >= 2) fp[b >> 3] |= MASK[b % 8];
        b = 48;
        if (ce.getCount("I") >= 4) fp[b >> 3] |= MASK[b % 8];
        b = 49;
        if (ce.getCount("Be") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 50;
        if (ce.getCount("Mg") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 51;
        if (ce.getCount("Al") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 52;
        if (ce.getCount("Ca") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 53;
        if (ce.getCount("Sc") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 54;
        if (ce.getCount("Ti") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 55;
        if (ce.getCount("V") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 56;
        if (ce.getCount("Cr") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 57;
        if (ce.getCount("Mn") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 58;
        if (ce.getCount("Fe") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 59;
        if (ce.getCount("Co") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 60;
        if (ce.getCount("Ni") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 61;
        if (ce.getCount("Cu") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 62;
        if (ce.getCount("Zn") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 63;
        if (ce.getCount("Ga") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 64;
        if (ce.getCount("Ge") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 65;
        if (ce.getCount("As") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 66;
        if (ce.getCount("Se") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 67;
        if (ce.getCount("Kr") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 68;
        if (ce.getCount("Rb") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 69;
        if (ce.getCount("Sr") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 70;
        if (ce.getCount("Y") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 71;
        if (ce.getCount("Zr") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 72;
        if (ce.getCount("Nb") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 73;
        if (ce.getCount("Mo") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 74;
        if (ce.getCount("Ru") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 75;
        if (ce.getCount("Rh") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 76;
        if (ce.getCount("Pd") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 77;
        if (ce.getCount("Ag") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 78;
        if (ce.getCount("Cd") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 79;
        if (ce.getCount("In") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 80;
        if (ce.getCount("Sn") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 81;
        if (ce.getCount("Sb") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 82;
        if (ce.getCount("Te") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 83;
        if (ce.getCount("Xe") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 84;
        if (ce.getCount("Cs") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 85;
        if (ce.getCount("Ba") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 86;
        if (ce.getCount("Lu") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 87;
        if (ce.getCount("Hf") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 88;
        if (ce.getCount("Ta") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 89;
        if (ce.getCount("W") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 90;
        if (ce.getCount("Re") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 91;
        if (ce.getCount("Os") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 92;
        if (ce.getCount("Ir") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 93;
        if (ce.getCount("Pt") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 94;
        if (ce.getCount("Au") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 95;
        if (ce.getCount("Hg") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 96;
        if (ce.getCount("Tl") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 97;
        if (ce.getCount("Pb") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 98;
        if (ce.getCount("Bi") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 99;
        if (ce.getCount("La") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 100;
        if (ce.getCount("Ce") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 101;
        if (ce.getCount("Pr") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 102;
        if (ce.getCount("Nd") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 103;
        if (ce.getCount("Pm") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 104;
        if (ce.getCount("Sm") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 105;
        if (ce.getCount("Eu") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 106;
        if (ce.getCount("Gd") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 107;
        if (ce.getCount("Tb") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 108;
        if (ce.getCount("Dy") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 109;
        if (ce.getCount("Ho") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 110;
        if (ce.getCount("Er") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 111;
        if (ce.getCount("Tm") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 112;
        if (ce.getCount("Yb") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 113;
        if (ce.getCount("Tc") >= 1) fp[b >> 3] |= MASK[b % 8];
        b = 114;
        if (ce.getCount("U") >= 1) fp[b >> 3] |= MASK[b % 8];
    }
826565
public void incrementAll(Collection<T> elements, double inc) {
        for (T element: elements) {
            incrementCount(element, inc);
        }
    }
984540
public void add(RationalCounter<? extends T> counter) {
        for (Map.Entry<? extends T,Double> e : counter) {
            T t = e.getKey();
            Double cur = counts.get(t);
            counts.put(t, (cur == null) ? e.getValue() : cur + e.getValue());
        }
    }
1083783
@Override
	public BigInteger getCount() {
		BigInteger cached = cachedCount;
		if(cached == null) {
			cachedCount = cached = getCountImpl();
		}
		return cached;
	}
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");
    }
439370
int countOnes(int from, int to) {
		if (from < 0) throw new IllegalArgumentException();
		if (from > to) throw new IllegalArgumentException();
		from += start;
		to += start;
		if (to > finish) throw new IllegalArgumentException();
		return countOnesAdj(from, to);
	}
954751
private void init(AnnotatedElement element) {
		Annotation[] declaredAnnotations = element.getDeclaredAnnotations();
		this.declaredAnnotationMap = new HashMap<>();
		parseDeclared(declaredAnnotations);
		
		Annotation[] annotations = element.getAnnotations();
		if(declaredAnnotations == annotations) {
			this.annotationMap = this.declaredAnnotationMap;
		}else {
			this.annotationMap = new HashMap<>();
			parse(annotations);
		}
	}
190088
@Override
	public int size() {

		if (allElementsInCache) {
			return orderedCache.size();
		} else {
			int count = 0;
			try (final RocksBytesIterator iterator = orderedBytesIterator()) {
				while (iterator.hasNext()) {
					iterator.next();
					++count;
				}
			}
			return count;
		}
	}
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();
    }