1 26 27 package org.objectweb.ccm.IDL3; 28 29 37 38 public class ExceptionListImpl 39 implements ExceptionList 40 { 41 47 50 protected org.objectweb.ccm.util.Vector list_; 51 52 58 61 public ExceptionListImpl() 62 { 63 list_ = new org.objectweb.ccm.util.Vector(); 65 } 66 67 73 76 protected void 77 destroy() 78 { 79 for (int i=0;i<list_.size();i++) 80 { 81 ((ExceptionRef)list_.get(i)).removeRef(); 82 } 83 } 84 85 91 96 public void 97 add(ExceptionRef exception) 98 { 99 if (exception != null) 100 { 101 exception.addRef(); 102 list_.add(exception); 103 } 104 } 105 106 109 public ExceptionDecl[] 110 getExceptions() 111 { 112 ExceptionDecl[] result = new ExceptionDecl[list_.size()]; 113 114 for(int i=0; i<result.length; i++) 115 result[i] = (ExceptionDecl)(list_.get(i)); 116 117 return result; 118 } 119 120 123 public org.omg.CORBA.ExceptionDef [] 124 getExceptionDefs() 125 { 126 org.omg.CORBA.ExceptionDef [] result = new org.omg.CORBA.ExceptionDef [list_.size()]; 127 128 for(int i=0; i<result.length; i++) 129 result[i] = ((ExceptionRef)list_.get(i)).getExceptionDef(); 130 131 return result; 132 } 133 134 137 public org.omg.CORBA.ExceptionDescription [] 138 getExceptionDescriptions() 139 { 140 org.omg.CORBA.ExceptionDescription [] result = new org.omg.CORBA.ExceptionDescription [list_.size()]; 141 142 ExceptionDeclImpl exc = null; 143 for(int i=0; i<result.length; i++) 144 { 145 exc = (ExceptionDeclImpl)list_.get(i); 146 result[i] = new org.omg.CORBA.ExceptionDescription (exc.getName(), 147 exc.getId(), 148 exc.the_parent_.getId(), 149 exc.getVersion(), 150 exc.getExceptionDef().type()); 151 } 152 153 return result; 154 } 155 } 156 | Popular Tags |