com.scudata.ide.spl.ProcessWatchThread Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of esproc Show documentation
Show all versions of esproc Show documentation
SPL(Structured Process Language) A programming language specially for structured data computing.
package com.scudata.ide.spl;
import java.io.InputStream;
import java.util.Scanner;
/**
* ?ȴ??̣߳????ڽ???Process???ص???Ϣ
*/
public class ProcessWatchThread extends Thread {
InputStream in;
boolean over;
public ProcessWatchThread(InputStream in) {
this.in = in;
over = false;
}
public void run() {
if (in == null)
return;
Scanner br = null;
try {
br = new Scanner(in);
while (true) {
if (in == null || over)
break;
while (br.hasNextLine()) {
String tempStream = br.nextLine();
if (tempStream.trim() == null
|| tempStream.trim().equals(""))
continue;
outputLine(tempStream);
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (br != null) {
br.close();
}
}
}
protected void outputLine(String line) {
System.out.println(line);
}
public void setOver(boolean over) {
this.over = over;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy