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