📄 output.java
字号:
//package kwic.pf;
import java.io.IOException;
import javax.swing.*;
import javax.swing.text.*;
/* Output prints the data from its input pipe on the standard output.*/
public class Output extends Filter
{
private JTextArea resultPane;
private String filterType;
public Output(Pipe input, JTextArea resultPanel,String filterType)
{
super(input, null);
resultPane = resultPanel;
this.filterType=filterType;
}
/* This method writes the data from the input pipe on the standard output. */
protected void transform()
{
try
{
int c = input_.read();
while(c != -1)
{
System.out.print((char) c);
resultPane.append(""+(char)c);
c = input_.read();
}
if(filterType.compareTo("a2")==0 ||filterType.compareTo("a3")==0 )
System.out.println();
}
catch(IOException exc){
exc.printStackTrace();
System.err.println("KWIC Error: Broken pipe");
System.exit(1);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -