1 26 27 package org.objectweb.openccm.ast.lib; 28 29 30 import org.objectweb.openccm.ast.api.UnionMember; 31 32 48 49 public class UnionMemberListImpl 50 extends ListBaseImpl 51 implements org.objectweb.openccm.ast.api.UnionMemberList 52 { 53 59 65 66 public 67 UnionMemberListImpl() 68 { 69 super(); 71 } 72 73 79 85 93 public org.omg.CORBA.UnionMember [] 94 getUnionMemberSeq(org.omg.CORBA.TypeCode discriminator) 95 { 96 org.omg.CORBA.UnionMember [] result = 98 new org.omg.CORBA.UnionMember [getSize()]; 99 100 java.util.Iterator it = iterator(); 102 for(int i=0; it.hasNext(); i++) 103 { 104 UnionMemberImpl um = (UnionMemberImpl)it.next(); 106 107 result[i] = um.getUnionMember(discriminator); 109 } 110 111 return result; 113 } 114 115 121 127 134 public void 135 addMember(String name, 136 org.objectweb.openccm.ast.api.TypeRef type, 137 org.objectweb.openccm.ast.api.AnyValue value) 138 { 139 if ((type!=null) && (name!=null) && (value!=null)) 140 { 141 super.addObject( new UnionMemberImpl(name, type, 142 (AnyValueImpl)value) ); 143 } 144 } 145 146 151 public UnionMember[] 152 getUnionMembers() 153 { 154 return (UnionMember[])super.toArray(new UnionMember[0]); 155 } 156 } 157 | Popular Tags |