我正在
systemB\Plumber.java:44: error: cannot find symbol
FilterOut.Connect(FilterWildPoints.pipe1);
^
symbol: variable pipe1
location: variable FilterWildPoints of type MiddleFilter
systemB\Plumber.java:56: error: cannot find symbol
FilterWildPoints.pipe1.start();
^
symbol: variable pipe1
location: variable FilterWildPoints of type MiddleFilter
2 errors
即使您,FilterWildPoints也具有公共成员变量pipe1。
一个好主意是让“狂野点过滤器”将流分成另外两个管道,并将其中一个管道连接到输出。
Plumber.java:
package systemB;
public class Plumber
{
public static void main( String argv[])
{
SourceFilter FilterIn = new SourceFilter("./datasets/FlightData.dat");
MiddleFilter FilterTemperature = new MiddleFilterTemperature();
MiddleFilter FilterAltitude = new MiddleFilterAltitude();
MiddleFilter FilterWildPoints = new MiddleFilterWildPoints();
SinkFilter FilterOut = new SinkFilter("./OutputB.dat");
FilterOut.Connect(FilterWildPoints.pipe1);
FilterWildPoints.Connect(FilterAltitude);
FilterAltitude.Connect(FilterTemperature);
FilterTemperature.Connect(FilterIn);
FilterIn.start();
FilterTemperature.start();
FilterAltitude.start();
FilterWildPoints.pipe1.start();
FilterOut.start();
} // main
} // Plumber
MiddleFilterWildPoints.java:
package systemB;
import java.nio.ByteBuffer;
public class MiddleFilterWildPoints extends MiddleFilter
{
public MiddleFilter pipe1;
public MiddleFilter pipe2;
MiddleFilterWildPoints()
{
this.pipe1 = new MiddleFilter();
this.pipe2 = new MiddleFilter();
}
//...
} // MiddleFilter
我对Java不太熟悉,需要此代码进行赋值,但是找不到错误。
30秒到达战场
相关分类