View Javadoc

1   /**
2    * Copyright (c) 2010 Yahoo! Inc. All rights reserved.
3    *
4    *   http://www.apache.org/licenses/LICENSE-2.0
5    *
6    * Unless required by applicable law or agreed to in writing, software
7    * distributed under the License is distributed on an "AS IS" BASIS,
8    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9    * See the License for the specific language governing permissions and
10   * limitations under the License.
11   */
12  package org.apache.omid.benchmarks.utils;
13  
14  /**
15   * An expression that generates a sequence of string values, following some distribution (Uniform, Zipfian, Sequential, etc.)
16   */
17  public abstract class Generator {
18      /**
19       * Generate the next string in the distribution.
20       */
21      public abstract String nextString();
22  
23      /**
24       * Return the previous string generated by the distribution; e.g., returned from the last nextString() call.
25       * Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet
26       * been called, lastString() should return something reasonable.
27       */
28      public abstract String lastString();
29  }
30