1 16 package org.apache.cocoon.caching.validity; 17 18 25 public class NameValueEvent extends Event { 26 27 private String m_name; 28 private String m_value; 29 private int m_hashcode; 30 31 38 public NameValueEvent(String name, String value) { 39 m_name = name; 40 m_value = value; 41 m_hashcode = (name + value).hashCode(); 42 } 43 44 48 public boolean equals(Event e) { 49 if (e instanceof NameValueEvent) { 50 NameValueEvent nve = (NameValueEvent)e; 51 return ( m_name.equals(nve.m_name) && 52 m_value.equals(nve.m_value) ); 53 } 54 return false; 55 } 56 57 public int hashCode() { 58 return m_hashcode; 59 } 60 61 public String toString() { 62 return "NameValueEvent[" + m_name + "," + m_value + "]"; 63 } 64 } 65 | Popular Tags |