1 /***
2 * Copyright 2003-2010 Terracotta, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package net.sf.ehcache.util.counter.sampled;
18
19 /***
20 * Interface of a sampled rate counter -- a counter that keeps sampled values of
21 * rates
22 *
23 * @author <a href="mailto:asanoujam@terracottatech.com">Abhishek Sanoujam</a>
24 * @since 1.7
25 *
26 */
27 public interface SampledRateCounter extends SampledCounter {
28
29 /***
30 * Increments the numerator and denominator by the passed values
31 *
32 * @param numerator
33 * @param denominator
34 */
35 void increment(long numerator, long denominator);
36
37 /***
38 * Decrements the numerator and denominator by the passed values
39 *
40 * @param numerator
41 * @param denominator
42 */
43 void decrement(long numerator, long denominator);
44
45 /***
46 * Sets the values of the numerator and denominator to the passed values
47 *
48 * @param numerator
49 * @param denominator
50 */
51 void setValue(long numerator, long denominator);
52
53 /***
54 * Sets the value of the numerator to the passed value
55 *
56 * @param newValue
57 */
58 void setNumeratorValue(long newValue);
59
60 /***
61 * Sets the value of the denominator to the passed value
62 *
63 * @param newValue
64 */
65 void setDenominatorValue(long newValue);
66
67 }