1 26 27 package org.objectweb.openccm.ast.lib; 28 29 30 import org.objectweb.openccm.ast.api.TypeRef; 31 32 33 import org.objectweb.openccm.ast.api.Parameter; 34 35 36 import org.omg.CORBA.ParameterMode ; 37 38 39 import org.omg.CORBA.ParameterDescription ; 40 41 42 import org.omg.CORBA.StructMember ; 43 44 60 61 public class ParameterListImpl 62 extends ListBaseImpl 63 implements org.objectweb.openccm.ast.api.ParameterList 64 { 65 71 77 80 public ParameterListImpl() 81 { 82 super(); 84 } 85 86 92 98 protected void 99 addParam(String name, 100 TypeRef type, 101 ParameterMode mode) 102 { 103 if (type!=null) 104 { 105 super.addObject( new ParameterImpl(name, type, mode) ); 106 } 107 } 108 109 115 120 public ParameterDescription [] 121 getParameterDescriptionSeq() 122 { 123 ParameterDescription [] result = new ParameterDescription [getSize()]; 125 126 java.util.Iterator it = iterator(); 128 for(int i=0; it.hasNext(); i++) 129 { 130 ParameterImpl param = (ParameterImpl)it.next(); 132 133 result[i] = param.getParameterDescription(); 135 } 136 137 return result; 139 } 140 141 146 public StructMember [] 147 getStructMemberSeq() 148 { 149 StructMember [] result = new StructMember [getSize()]; 151 152 java.util.Iterator it = iterator(); 154 for(int i=0; it.hasNext(); i++) 155 { 156 ParameterImpl param = (ParameterImpl)it.next(); 158 159 result[i] = param.getStructMember(); 161 } 162 163 return result; 165 } 166 167 173 179 public void 180 addInParam(String name, 181 TypeRef type) 182 { 183 addParam(name, type, ParameterMode.PARAM_IN); 184 } 185 186 192 public void 193 addOutParam(String name, 194 TypeRef type) 195 { 196 addParam(name, type, ParameterMode.PARAM_OUT); 197 } 198 199 205 public void 206 addInOutParam(String name, 207 TypeRef type) 208 { 209 addParam(name, type, ParameterMode.PARAM_INOUT); 210 } 211 212 217 public Parameter[] 218 getParameters() 219 { 220 return (Parameter[])super.toArray(new Parameter[0]); 221 } 222 } 223 | Popular Tags |