1 24 25 package org.objectweb.dream.multiplexer; 26 27 import java.io.Serializable ; 28 import java.util.Map ; 29 30 import org.objectweb.dream.Pull; 31 import org.objectweb.dream.Push; 32 33 39 public class Attachment implements Serializable , Cloneable 40 { 41 42 43 protected int id; 44 45 46 protected String [] inputNames; 47 48 49 protected Pull[] inputs; 50 51 52 protected Map [] inputContexts; 53 54 55 protected String [] outputNames; 56 57 58 protected Push[] outputs; 59 60 61 protected Map [] outputContexts; 62 63 74 public Attachment(int id, String [] inputNames, Pull[] inputs, 75 Map [] inputContexts, String [] outputNames, Push[] outputs, 76 Map [] outputContexts) 77 { 78 this.id = id; 79 this.inputNames = inputNames; 80 this.inputs = inputs; 81 this.inputContexts = inputContexts; 82 this.outputNames = outputNames; 83 this.outputs = outputs; 84 this.outputContexts = outputContexts; 85 } 86 87 90 public int getId() 91 { 92 return id; 93 } 94 95 98 public Map [] getInputContexts() 99 { 100 return inputContexts; 101 } 102 103 106 public void setInputContexts(Map [] inputContexts) 107 { 108 this.inputContexts = inputContexts; 109 } 110 111 114 public String [] getInputNames() 115 { 116 return inputNames; 117 } 118 119 122 public void setInputNames(String [] inputNames) 123 { 124 this.inputNames = inputNames; 125 } 126 127 130 public Map [] getOutputContexts() 131 { 132 return outputContexts; 133 } 134 135 138 public void setOutputContexts(Map [] outputContexts) 139 { 140 this.outputContexts = outputContexts; 141 } 142 143 146 public String [] getOutputNames() 147 { 148 return outputNames; 149 } 150 151 154 public void setOutputNames(String [] outputNames) 155 { 156 this.outputNames = outputNames; 157 } 158 159 162 public Pull[] getInputs() 163 { 164 return inputs; 165 } 166 167 170 public void setInputs(Pull[] inputs) 171 { 172 this.inputs = inputs; 173 } 174 175 178 public Push[] getOutputs() 179 { 180 return outputs; 181 } 182 183 186 public void setOutputs(Push[] outputs) 187 { 188 this.outputs = outputs; 189 } 190 191 194 public int hashCode() 195 { 196 return id; 197 } 198 199 205 public boolean equals(Object obj) 206 { 207 if (obj instanceof Attachment) 208 { 209 return (id == ((Attachment) obj).id); 210 } 211 return false; 212 } 213 214 222 public Object clone() 223 { 224 try 225 { 226 Attachment obj = (Attachment) super.clone(); 227 obj.inputs = null; 229 obj.outputs = null; 230 obj.inputContexts = null; 231 obj.outputContexts = null; 232 obj.inputNames = new String [inputNames.length]; 234 for (int i = 0; i < inputNames.length; i++) 235 { 236 obj.inputNames[i] = inputNames[i]; 237 } 238 obj.outputNames = new String [outputNames.length]; 240 for (int i = 0; i < outputNames.length; i++) 241 { 242 obj.outputNames[i] = outputNames[i]; 243 } 244 return obj; 245 } 246 catch (CloneNotSupportedException e) 247 { 248 throw new InternalError (); 250 } 251 } 252 } | Popular Tags |