1 26 27 package org.objectweb.ccm.IDL3; 28 29 37 38 public class ParameterListImpl 39 implements ParameterList 40 { 41 47 50 protected org.objectweb.ccm.util.Vector param_names_; 51 52 55 protected org.objectweb.ccm.util.Vector param_types_; 56 57 60 protected org.objectweb.ccm.util.Vector param_modes_; 61 62 68 71 public ParameterListImpl() 72 { 73 param_names_ = new org.objectweb.ccm.util.Vector(); 75 param_types_ = new org.objectweb.ccm.util.Vector(); 76 param_modes_ = new org.objectweb.ccm.util.Vector(); 77 } 78 79 85 90 protected org.omg.CORBA.ParameterDescription [] 91 getParameterDescs() 92 { 93 org.omg.CORBA.ParameterDescription [] result = 94 new org.omg.CORBA.ParameterDescription [param_names_.size()]; 95 96 for(int i=0; i<result.length; i++) 97 { 98 result[i] = new org.omg.CORBA.ParameterDescription ( 99 (String )param_names_.get(i), 100 org.objectweb.openccm.corba.TypeCodeUtils.getTC_void(), 101 ((TypeRef)param_types_.get(i)).getIDLType(), 102 org.omg.CORBA.ParameterMode.from_int(((Integer )param_modes_.get(i)).intValue())); 103 104 } 105 return result; 106 } 107 108 111 protected void 112 destroy() 113 { 114 for (int i=0;i<param_types_.size();i++) 115 { 116 ((TypeRef)param_types_.get(i)).removeRef(); 117 } 118 } 119 120 126 129 public void 130 addParam(String name, 131 TypeRef type, 132 int mode) 133 { 134 if (type!=null) 135 { 136 param_names_.add(name); 137 type.addRef(); 138 param_types_.add(type); 139 param_modes_.add(new Integer (mode)); 140 } 141 } 142 143 146 public String [] 147 getParamNames() 148 { 149 String [] result = new String [param_names_.size()]; 150 for (int i=0;i<result.length;i++) 151 { 152 result[i] = (String )param_names_.get(i); 153 } 154 return result; 155 } 156 157 160 public int[] 161 getParamModes() 162 { 163 int[] result = new int[param_modes_.size()]; 164 for (int i=0;i<result.length;i++) 165 { 166 result[i] = ((Integer )param_modes_.get(i)).intValue(); 167 } 168 return result; 169 } 170 171 174 public TypeRef[] 175 getParamTypes() 176 { 177 TypeRef[] result = new TypeRef[param_types_.size()]; 178 for (int i=0;i<result.length;i++) 179 { 180 result[i] = (TypeRef)param_types_.get(i); 181 } 182 return result; 183 } 184 } 185 | Popular Tags |