Changeset 251


Ignore:
Timestamp:
Apr 10, 2007, 12:12:31 PM (15 years ago)
Author:
Johan Enell
Message:

changed getCount

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/se/lu/onk/NullPlugin/src/base1null/Base1NullPlugin.java

    r149 r251  
    2424package base1null;
    2525
     26import java.io.BufferedReader;
    2627import java.io.File;
     28import java.io.FileReader;
     29import java.io.IOException;
     30import java.io.InputStreamReader;
     31import java.io.PrintWriter;
    2732import java.util.List;
    2833
     
    4146    throws Exception
    4247  {
     48    readStdin();
     49    readFile();
     50   
    4351    BASEFileReader bfr;
    4452    bfr = new BASEFileReader(new File("stdin.txt"));
     
    5462   
    5563    BASEFileSpotSection<Reporter, Spot> bfss = bfr.readSpotSection();
    56     bfss.setDataMatrix(bfss.getCountHeader(), bfss.getAssaysHeader().size());
     64    bfss.setDataMatrix(bfss.getCount(), bfss.getAssays().size());
    5765    if (bfss != null)
    5866    {
     
    106114  }
    107115
     116  private static void readFile() throws IOException
     117  {
     118    PrintWriter out = new PrintWriter("readStdinFile.txt");
     119    BufferedReader in = new BufferedReader(new FileReader("stdin.txt"));
     120   
     121    for (int i = 0; i < 100; i++)
     122    {
     123      out.printf("%4d:%s%n",i, in.readLine());
     124    }
     125   
     126    out.close();
     127  }
     128
     129  private static void readStdin() throws IOException
     130  {
     131    PrintWriter out = new PrintWriter("readStdinStream.txt");
     132    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
     133   
     134    for (int i = 0; i < 100; i++)
     135    {
     136      out.printf("%4d:%s%n",i, in.readLine());
     137    }
     138   
     139    out.close();
     140  }
     141
    108142}
Note: See TracChangeset for help on using the changeset viewer.