1 26 27 package org.objectweb.openccm.ast.lib; 28 29 30 import org.objectweb.openccm.ast.api.StructMember; 31 32 48 49 public class StructMemberListImpl 50 extends ListBaseImpl 51 implements org.objectweb.openccm.ast.api.StructMemberList 52 { 53 59 65 68 public 69 StructMemberListImpl() 70 { 71 super(); 73 } 74 75 81 87 92 public org.omg.CORBA.StructMember [] 93 getStructMemberSeq() 94 { 95 org.omg.CORBA.StructMember [] result = 97 new org.omg.CORBA.StructMember [getSize()]; 98 99 java.util.Iterator it = iterator(); 101 for(int i=0; it.hasNext(); i++) 102 { 103 StructMemberImpl sm = (StructMemberImpl)it.next(); 105 106 result[i] = sm.getStructMember(); 108 } 109 110 return result; 112 } 113 114 121 public String 122 nameAt(int index) 123 { 124 return ((StructMemberImpl)super.get(index)).getName(); 125 } 126 127 133 139 public void 140 addMember(String name, 141 org.objectweb.openccm.ast.api.TypeRef type) 142 { 143 if(type != null) 144 { 145 super.addObject( new StructMemberImpl(name, type) ); 146 } 147 } 148 149 154 public StructMember[] 155 getStructMembers() 156 { 157 return (StructMember[])super.toArray(new StructMember[0]); 158 } 159 } 160 | Popular Tags |