1 23 24 package com.sun.enterprise.config.serverbeans.validation; 25 26 import java.util.HashMap ; 27 import java.util.Map ; 28 29 30 33 34 35 41 42 class FrameHolder { 43 public boolean equals(Object o){ 44 return o == this || 45 (o != null && o instanceof FrameHolder && this.equals((FrameHolder) o)); 46 } 47 48 private boolean equals(FrameHolder o){ 49 return this.domain.equals( o.domain) && 50 this.configFrames.equals(o.configFrames) && 51 this.serverFrames.equals(o.serverFrames) && 52 this.clusterFrames.equals(o.clusterFrames); 53 } 54 55 public int hashCode(){ 56 return getDomainFrame().hashCode(); 57 } 58 59 Frame getDomainFrame(){ 60 return domain; 61 } 62 63 Frame getConfigFrame(String n) { 64 return memoizedGet(configFrames, n); 65 } 66 67 Frame getServerFrame(String n){ 68 return memoizedGet(serverFrames, n); 69 } 70 71 Frame getClusterFrame(String n){ 72 return memoizedGet(clusterFrames, n); 73 } 74 75 private final Frame memoizedGet(Map m, String n){ 76 Frame result = (Frame) m.get(n); 77 if (result == null) { 78 result = Frame.newFrame(); 79 m.put(n, result); 80 } 81 return result; 82 } 83 84 85 private final Frame domain = Frame.newFrame(); 86 private final Map configFrames = new HashMap (); 87 private final Map serverFrames = new HashMap (); 88 private final Map clusterFrames = new HashMap (); 89 90 91 92 } 93 | Popular Tags |