Hi all ,

im a java noob and i have been working on this coding for a couple of days now. I now understand all of the methods associated with vectors and streamtokenizers. Anyhows i am trying to store the values of every token parsed through the inputStream so that i can store it either as a vector or arraylist or array(preferably), from where i will create objects from certain locations in the array/vector.

The problem i have though is that the Vector cannot store primitive values just objects and arrays can only have 1 type of value, however the txt file in the inputStream holds int, String and char values and arraylist cannot be searched through. So obviously, thats why im using a StreamTokenizer (TT_WORD, TT_NUMBER etc..) , but i just am at a complete loss, i think i have looked at this coding for too long and am stuck any ideas anyone?

Code:
import java.io.*; 
import java.util.*;

class t
    {
    
    /* Main method  */

    public static void main(String[] args) throws IOException
        {
	FileReader file = new FileReader("Stock.txt");
	StreamTokenizer inputStream = new StreamTokenizer(file);
	int tokenType = 0;
	int numberOfTokens = -1;
	
	
	
	// Process the file and output the number of tokens in the file
	
	do {
	    tokenType = inputStream.nextToken();
	    outputTtype(tokenType,inputStream);
	    numberOfTokens++;
	    	    
	    } 
	    
	    
	    while (tokenType != StreamTokenizer.TT_EOF);
	    
	// Output result and close file
	    
	System.out.println("Number of tokens = " + numberOfTokens);
	}
   
   /* OUTPUT TTYPE:  Methof to output the ttype of a stream token and 
   its value. */
   
   private static void outputTtype(int ttype, StreamTokenizer inStream) {
       
     
       switch (ttype) {
        
        
         ///////***////TT_EOL/////////***/////
        case StreamTokenizer.TT_EOL:
        
        
	   	System.out.println("EOL");
		break; 	
		/////////////////////////
		
		
		//////***/////TT_EOF/////***/////////
        case StreamTokenizer.TT_EOF:
	   	System.out.println("TT_EOF");
		break;
		/////////////////////////
	   	 		
	   
	   ///***////////TT_WORD/////////***/////
	   case StreamTokenizer.TT_WORD:
	    
	   
	   
	   	System.out.println("TT_WORD: sval = " + inStream.sval);
		break;	
        /////////////////////////
        
        	   	//////***////TT_NUMBER//////***///////// 
	   	   case StreamTokenizer.TT_NUMBER:
	   	   int IntCounter=0;
	   	   IntCounter++;
	   	   
	   	   System.out.println("TT_NUMBER: nval = " + inStream.nval);
		break;
		/////////////////////////
	   	   
        
        //////***/////DEFAULT///***///////////
           default:
	   	System.out.println("Unknown: nval = " + inStream.nval +
				 " sval = " + inStream.sval);
		break;
		/////////////////////////
		
	   }
       }
   }