public void setCardinality ( double cardinality ) { if ( cardinality < 0 || Double . isNaN ( cardinality ) ) throw new IllegalArgumentException ( "Cardinality must be a positive integer or infinity, not " + cardinality ) ; this . cardinality = Math . ceil ( cardinality ) ; fixCache ( ) ; }
Sets the cardinality of the distribution defining the maximum number of items that Zipf can return .