00001 package TxTPackage;
00002
00003 import java.io.*;
00004
00005 import debuggingCode.Debug;
00006
00007
00008
00009 public class Uitleesklasse {
00014 private input ds;
00015
00016 public Uitleesklasse(String filename){
00017 try{
00018 ds = new input(new FileReader(filename));
00019 }
00020 catch(Exception e){
00021 e.printStackTrace();
00022 }
00023 }
00024
00025 public float readnext(){
00026 float[] lees= readnext(1);
00027 return lees[0];
00028 }
00029
00030 public float EOFreadnext() throws EOFException,IOException{
00031 float d=0;
00032 try{
00033 d = ds.readFloat();
00034 }
00035 catch(FileNotFoundException e)
00036 {
00037 Debug.print(e);
00038 System.exit(1);
00039 }
00040
00041
00042
00043 return d;
00044 }
00045
00046 public float[] readnext(int aantal){
00047 float[] rij=new float[aantal];
00048 try
00049 {
00050 for(int i =0;i!=aantal;i++){
00051 float d = ds.readFloat();
00052 rij[i]=d;
00053 }
00054 }
00055
00056
00057 catch(FileNotFoundException e)
00058 {
00059 Debug.print(e);
00060 System.exit(1);
00061 }
00062 catch(EOFException e)
00063 {
00064 if(!Debug.DISTIBUTION) Debug.print("End of file, no problem");
00065 }
00066
00067 catch(IOException e)
00068 {
00069 Debug.print(e);
00070 System.exit(1);
00071 }
00072 return rij;
00073 }
00074 protected static Uitleesklasse theinstance;
00075
00076
00077
00078
00079
00080
00081
00082
00083 }
00084
00085