我变得非常厌倦了这个问题,我不知道该怎么办找到。编辑在收集
import ...
class ...
private ArrayList <Operation> operationList = new ArrayList<Operation>();
@Override
public Collection<String> lineList() {
Set <String> groupOperation = new HashSet<String>();
Operace newOperation= null;
LogFileReader reader = new LogFileReader(nameFile);
LogEntry line = reader.nextLine();
while(reader.existsLine()) {
for(Operation whatever2: operationList) {
if(line.getOperation().equals(whatever2.getName())) {
whatever2.setAmmount(whatever2.getAmmount()+1);
line = reader.nextLine();
}
}
newOperation = new Operation(line.getOperation());
newOperation.setAmmount(1);
groupOperation .add(newOperation);
line = reader.nextLine();
}
....
return groupOperation;
}
- 的问题是在同时随着对(x和y:Z)IF(),其他的事情 工作。
(如果我会删除整个FOR,现在看来,它的工作原理,但我需要计时。)
在类的操作只getter和setter的“名”和“ammount的”。
- 解释
- 我读的文件。
- 我从文件中读取唯一的话题。
- 我加载类似于一个操作(名称=标题,ammount =文件中有多少次相同)
- 我给它的ArrayList = IT DOESNT工作非常好!
- 从ArrayList的设置,这就是接口。
- GUI接口。
EDIT1: “异常线程 ”AWT-EventQueue的-0“ 显示java.lang.NullPointerException”
我希望有人会明白,
感谢大家,
MmM ...
您需要发布SSCCE(http://sscce.org/)。这将有助于您获得更好的答案,并让人们了解您的要求。 – Coupon22
请发布完整的stacktrace。 – Coupon22