/** NamedIntList class // This class assembles lists of integers - primarily for // testing **/ package ciips.animation; import java.awt.*; import java.io.*; import java.net.*; import java.util.*; public class NamedIntList extends IntList { private String name; private static final boolean DEBUG = false; public static String getID() { return "NIL"; } public NamedIntList( URL url ) /* throws Exception */ { String line; InputStreamReader isr; try { URLConnection urlc = url.openConnection(); isr = new InputStreamReader( urlc.getInputStream() ); br = new BufferedReader( isr ); if ((line = br.readLine()) != null) { int tot = 0; name = line.trim(); while( (line = br.readLine()) != null ) { tot += add( line ); } if( DEBUG ) System.out.println( "NamedIntList[" + name + "](" + tot + "/" + num + ")" ); } } catch( IOException e ) { System.out.println("NamedIntList: URL connection error"); } } /** Add integers from a string to the list **/ public int add( String line ) { int k, j; String item1; Vector x = new Vector( 10 ); if( DEBUG ) System.out.println("NamedIntList:add line [" + line + "]" ); StringTokenizer Data = new StringTokenizer(line, " "); while( Data.hasMoreTokens() ) { item1 = Data.nextToken(); if ( item1 == null ) break; if( DEBUG ) System.out.println("IntList - item [" + item1 + "]"); // x.add( item1 ); x.addElement( item1 ); } if( DEBUG ) System.out.println("NamedIntList:add - found " + x.size() + " items" ); int new_array[] = new int[num + x.size()]; for(k=0;k