1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| package org.jboss.cache.eviction; |
8 |
| |
9 |
| import org.jboss.cache.config.Dynamic; |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| public class LFUConfiguration extends EvictionPolicyConfigBase |
27 |
| { |
28 |
| |
29 |
| private static final long serialVersionUID = 1865801530398969179L; |
30 |
| |
31 |
| @Dynamic |
32 |
| private int minNodes; |
33 |
| |
34 |
26
| public LFUConfiguration()
|
35 |
| { |
36 |
26
| super();
|
37 |
| } |
38 |
| |
39 |
44
| @Override
|
40 |
| protected void setEvictionPolicyClassName() |
41 |
| { |
42 |
44
| setEvictionPolicyClass(LFUPolicy.class.getName());
|
43 |
| } |
44 |
| |
45 |
12532
| public int getMinNodes()
|
46 |
| { |
47 |
12532
| return minNodes;
|
48 |
| } |
49 |
| |
50 |
23
| public void setMinNodes(int minNodes)
|
51 |
| { |
52 |
23
| testImmutability("minNodes");
|
53 |
23
| this.minNodes = minNodes;
|
54 |
| } |
55 |
| |
56 |
0
| public String toString()
|
57 |
| { |
58 |
0
| StringBuffer ret = new StringBuffer();
|
59 |
0
| ret.append("LFUConfiguration: maxNodes = ").append(getMaxNodes()).append(" minNodes = ").append(getMinNodes());
|
60 |
0
| return ret.toString();
|
61 |
| } |
62 |
| |
63 |
0
| @Override
|
64 |
| public boolean equals(Object obj) |
65 |
| { |
66 |
0
| if (obj instanceof LFUConfiguration && super.equals(obj))
|
67 |
| { |
68 |
0
| return (this.minNodes == ((LFUConfiguration) obj).minNodes);
|
69 |
| } |
70 |
0
| return false;
|
71 |
| } |
72 |
| |
73 |
43
| @Override
|
74 |
| public int hashCode() |
75 |
| { |
76 |
43
| int result = super.hashCode();
|
77 |
43
| result = 31 * result + minNodes;
|
78 |
43
| return result;
|
79 |
| } |
80 |
| |
81 |
| } |