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 * @return next String
21 */
22 public abstract String nextString();
23
24 /**
25 * Return the previous string generated by the distribution; e.g., returned from the last nextString() call.
26 * Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet
27 * been called, lastString() should return something reasonable
28 * @return last string
29 */
30 public abstract String lastString();
31 }
32