01: package org.wings.plaf.css;
02:
03: import org.wings.SComponent;
04: import org.wings.plaf.Update;
05:
06: public abstract class AbstractUpdate<COMPONENT_TYPE extends SComponent>
07: implements Update {
08:
09: protected final COMPONENT_TYPE component;
10:
11: public AbstractUpdate(COMPONENT_TYPE component) {
12: if (component == null)
13: throw new IllegalArgumentException(
14: "Component must not be null!");
15:
16: this .component = component;
17: }
18:
19: public final COMPONENT_TYPE getComponent() {
20: return component;
21: }
22:
23: public int getProperty() {
24: return FINE_GRAINED_UPDATE;
25: }
26:
27: public int getPriority() {
28: return 1;
29: }
30:
31: public abstract Handler getHandler();
32:
33: @Override
34: public boolean equals(Object object) {
35: if (object == this )
36: return true;
37: if (object == null || object.getClass() != this .getClass())
38: return false;
39:
40: Update other = (Update) object;
41:
42: if (!this .getComponent().equals(other.getComponent()))
43: return false;
44: if (this .getProperty() != other.getProperty())
45: return false;
46: if (this .getPriority() != other.getPriority())
47: return false;
48:
49: return true;
50: }
51:
52: @Override
53: public int hashCode() {
54: int hashCode = 17;
55: int dispersionFactor = 37;
56:
57: hashCode = hashCode * dispersionFactor
58: + this.getComponent().hashCode();
59: hashCode = hashCode * dispersionFactor + this.getProperty();
60: hashCode = hashCode * dispersionFactor + this.getPriority();
61:
62: return hashCode;
63: }
64:
65: }
|