FileDocCategorySizeDatePackage
tabSeparatedValueHandler.javaAPI DocExample831Thu Apr 03 15:27:58 BST 1997None

tabSeparatedValueHandler

public class tabSeparatedValueHandler extends ContentHandler

Fields Summary
Constructors Summary
Methods Summary
public java.lang.ObjectgetContent(java.net.URLConnection uc)

  
    String theLine;
    Vector v = new Vector();
     
    try {  
      DataInputStream dis = new DataInputStream(uc.getInputStream());   
      while ((theLine = dis.readLine()) != null) {
        String[] linearray = lineToArray(theLine);
        v.addElement(linearray);
      }
    }
    catch (IOException e) {
    }
      
    return v;
  
  
private java.lang.String[]lineToArray(java.lang.String line)

  
    StringTokenizer st = new StringTokenizer(line, "\t");
    int numFields = st.countTokens();
    String[] fields = new String[numFields];
    for (int i = 0; i < numFields; i++) {
      fields[i] = st.nextToken();
    }
    
    return fields;