1 7 package org.jboss.cache.tests.aop; 8 9 10 11 14 public class ValueObject { 15 16 private IdObject idObj; 17 private float value; 18 19 public ValueObject() { 20 } 22 public ValueObject(IdObject aIdObj, float aValue) { 23 idObj = aIdObj; 24 value = aValue; 25 } 27 public IdObject getIdObj() { 28 return idObj; 29 } 30 31 public float getValue() { 32 return value; 33 } 34 35 public String toString() { 36 return idObj + ": " + value; 37 } 39 public boolean equals(Object aObject) { 40 boolean result = false; 41 42 if ((aObject != null) && 43 (aObject.getClass().getName().equals( this.getClass().getName()))) { 44 result = idObj.equals(((ValueObject)aObject).idObj); 45 } 47 return result; 48 } 50 public int hashCode() { 51 return idObj.hashCode(); 52 } } | Popular Tags |