1 package org.jacorb.idl; 2 3 22 23 import java.io.PrintWriter ; 24 import java.util.*; 25 26 30 31 public class SymbolList 32 extends IdlSymbol 33 { 34 Vector v; 35 36 public SymbolList( int num ) 37 { 38 super( num ); 39 v = new Vector(); 40 } 41 42 public void setPackage( String s ) 43 { 44 s = parser.pack_replace( s ); 45 if( pack_name.length() > 0 ) 46 pack_name = s + "." + pack_name; 47 else 48 pack_name = s; 49 Enumeration e = v.elements(); 50 for( ; e.hasMoreElements(); ) 51 ( (IdlSymbol)e.nextElement() ).setPackage( s ); 52 } 53 54 55 public int size() 56 { 57 return v.size(); 58 } 59 60 public Enumeration elements() 61 { 62 return v.elements(); 63 } 64 65 public void parse() 66 { 67 Enumeration e = v.elements(); 68 for( ; e.hasMoreElements(); ) 69 ( (IdlSymbol)e.nextElement() ).parse(); 70 } 71 72 public void print( PrintWriter ps ) 73 { 74 Enumeration e = v.elements(); 75 if( e.hasMoreElements() ) 76 ( (IdlSymbol)e.nextElement() ).print( ps ); 77 78 for( ; e.hasMoreElements(); ) 79 { 80 ps.print( "," ); 81 ( (IdlSymbol)e.nextElement() ).print( ps ); 82 } 83 } 84 85 public String toString() 86 { 87 StringBuffer sb = new StringBuffer (); 88 Enumeration e = v.elements(); 89 90 if( e.hasMoreElements() ) 91 sb.append( (IdlSymbol)e.nextElement() ); 92 93 for( ; e.hasMoreElements(); ) 94 { 95 sb.append( "," + (IdlSymbol)e.nextElement() ); 96 } 97 return sb.toString(); 98 } 99 } 100 101 102 103 | Popular Tags |