Code example for BitSet

Methods: cardinality

0
		return this;
	} 
	 
	public BloomFilter build() 
	{ 
		if(valid.cardinality() != 4)
		{ 
			throw new RuntimeException("Not all fields are set!");
		} 
		 
		double fp = getActualMaxFalsePos();
		if( fp > maxFalsePos)
		{ 
			throw new MaxPostRateViolationException("The actaul max fale positive value is " + fp + ". It is larger than  " + maxFalsePos);
		} 
		return new BloomFilter(m, k, n, digest, maxFalsePos);
	} 
	 
	private double getActualMaxFalsePos() 
	{ 
		return Math.pow( (1 - Math.pow(Math.E, -k * (n + 0.5) / (m - 1) )), k);