annotate src/samer/units/VecWriter.java @ 8:5e3cbbf173aa tip

Reorganise some more
author samer
date Fri, 05 Apr 2019 22:41:58 +0100
parents bf79fb79ee13
children
rev   line source
samer@0 1 //
samer@0 2 // VecWriter.java
samer@0 3 //
samer@0 4 //
samer@0 5 // Created by Samer Abdallah on Mon Jun 10 2002.
samer@0 6 // Copyright (c) 2002 __MyCompanyName__. All rights reserved.
samer@0 7 //
samer@0 8
samer@0 9 package samer.units;
samer@0 10
samer@0 11 import samer.core.*;
samer@0 12 import samer.tools.*;
samer@0 13 import samer.maths.*;
samer@0 14 import java.io.*;
samer@0 15
samer@0 16 public class VecWriter extends AnonymousTask {
samer@0 17 Vec x; // the vector itself
samer@0 18 PrintWriter prn;
samer@0 19
samer@0 20 public VecWriter(Vec x, Writer out) throws Exception {
samer@0 21 this.x=x; prn = new PrintWriter(out);
samer@0 22 }
samer@0 23
samer@0 24 public void dispose() {
samer@0 25 try { prn.flush(); } catch (Exception ex) {}
samer@0 26 // prn.close();
samer@0 27 }
samer@0 28
samer@0 29 public void run() throws Exception {
samer@0 30 Vec.Iterator i=x.iterator();
samer@0 31 prn.print(i.next());
samer@0 32 while (i.more()) {
samer@0 33 prn.print(' ');
samer@0 34 prn.print(i.next());
samer@0 35 }
samer@0 36 prn.println();
samer@0 37 }
samer@0 38
samer@0 39 public void stopping() {
samer@0 40 try { prn.flush(); } catch (Exception ex) {}
samer@0 41 }
samer@0 42 }