1 7 15 16 package com.sun.corba.se.impl.corba; 17 18 import java.util.Vector ; 19 import org.omg.CORBA.ContextList ; 20 import org.omg.CORBA.Bounds ; 21 import org.omg.CORBA.ORB ; 22 23 public class ContextListImpl extends ContextList 24 { 25 private final int INITIAL_CAPACITY = 2; 26 private final int CAPACITY_INCREMENT = 2; 27 28 private org.omg.CORBA.ORB _orb; 29 private Vector _contexts; 30 31 public ContextListImpl(org.omg.CORBA.ORB orb) 32 { 33 _orb = orb; 35 _contexts = new Vector (INITIAL_CAPACITY, CAPACITY_INCREMENT); 36 } 37 38 public int count() 39 { 40 return _contexts.size(); 41 } 42 43 public void add(String ctxt) 44 { 45 _contexts.addElement(ctxt); 46 } 47 48 public String item(int index) 49 throws Bounds 50 { 51 try { 52 return (String ) _contexts.elementAt(index); 53 } catch (ArrayIndexOutOfBoundsException e) { 54 throw new Bounds (); 55 } 56 } 57 58 public void remove(int index) 59 throws Bounds 60 { 61 try { 62 _contexts.removeElementAt(index); 63 } catch (ArrayIndexOutOfBoundsException e) { 64 throw new Bounds (); 65 } 66 } 67 68 } 69 | Popular Tags |