1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package org.apache.commons.math.distribution; 19 20 /** 21 * The Zipf (or zeta) Distribution. 22 * <p> 23 * References: 24 * <ul> 25 * <li><a href="http://mathworld.wolfram.com/ZipfDistribution.html">Zipf 26 * Distribution</a></li> 27 * </ul> 28 * </p> 29 * 30 * @version $Revision: 729291 $ $Date: 2008-12-24 05:47:53 -0500 (Wed, 24 Dec 2008) $ 31 */ 32 public interface ZipfDistribution extends IntegerDistribution { 33 /** 34 * Get the number of elements (e.g. corpus size) for the distribution. 35 * 36 * @return the number of elements 37 */ 38 public int getNumberOfElements(); 39 40 /** 41 * Set the number of elements (e.g. corpus size) for the distribution. 42 * The parameter value must be positive; otherwise an 43 * <code>IllegalArgumentException</code> is thrown. 44 * 45 * @param n the number of elements 46 * @throws IllegalArgumentException if n ≤ 0 47 */ 48 public void setNumberOfElements(int n); 49 50 /** 51 * Get the exponent characterising the distribution. 52 * 53 * @return the exponent 54 */ 55 public double getExponent(); 56 57 /** 58 * Set the exponent characterising the distribution. 59 * The parameter value must be positive; otherwise an 60 * <code>IllegalArgumentException</code> is thrown. 61 * 62 * @param s the exponent 63 * @throws IllegalArgumentException if s ≤ 0.0 64 */ 65 public void setExponent(double s); 66 }