1 20 21 package org.jacorb.orb; 22 23 27 28 import java.util.*; 29 30 public class NVList 31 extends org.omg.CORBA.NVList 32 { 33 private Vector list; 34 private org.omg.CORBA.ORB orb; 35 36 NVList(org.omg.CORBA.ORB orb) 37 { 38 this.orb = orb; 39 list = new Vector(); 40 } 41 42 NVList(org.omg.CORBA.ORB orb, int count) 43 { 44 this.orb = orb; 45 list = new Vector(count); 46 } 47 48 public int count() 49 { 50 return list.size(); 51 } 52 53 public org.omg.CORBA.NamedValue add( int item_flags) 54 { 55 org.omg.CORBA.NamedValue nv = orb.create_named_value("", null, item_flags); 56 list.addElement( nv ); 57 return nv; 58 } 59 60 public org.omg.CORBA.NamedValue add_item(java.lang.String item_name, 61 int item_flags) 62 { 63 org.omg.CORBA.NamedValue nv = orb.create_named_value(item_name, null, item_flags); 64 list.addElement( nv ); 65 return nv; 66 } 67 68 public org.omg.CORBA.NamedValue add_value(java.lang.String item_name, 69 org.omg.CORBA.Any value, 70 int item_flags ) 71 { 72 org.omg.CORBA.NamedValue nv = orb.create_named_value(item_name, value, item_flags); 73 list.addElement( nv ); 74 return nv; 75 } 76 77 public org.omg.CORBA.NamedValue item(int index) 78 throws org.omg.CORBA.Bounds 79 { 80 try 81 { 82 return (NamedValue)list.elementAt(index); 83 } 84 catch ( ArrayIndexOutOfBoundsException e ) 85 { 86 throw new org.omg.CORBA.Bounds (); 87 } 88 } 89 90 public void remove(int index) 91 throws org.omg.CORBA.Bounds 92 { 93 try 94 { 95 list.removeElementAt(index); 96 } 97 catch ( ArrayIndexOutOfBoundsException e ) 98 { 99 throw new org.omg.CORBA.Bounds (); 100 } 101 } 102 103 public java.util.Enumeration enumerate() 104 { 105 return list.elements(); 106 } 107 108 109 110 } 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | Popular Tags |