* All Rights Reserved.
*/
-
import java.util.Iterator;
-import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.jface.text.source.IAnnotationModel;
/**
* Filters problems based on their types.
*/
public class ProblemAnnotationIterator implements Iterator {
-
+
private Iterator fIterator;
+
private IProblemAnnotation fNext;
+
private boolean fSkipIrrelevants;
-
- public ProblemAnnotationIterator(IAnnotationModel model, boolean skipIrrelevants) {
- fIterator= model.getAnnotationIterator();
- fSkipIrrelevants= skipIrrelevants;
+
+ public ProblemAnnotationIterator(IAnnotationModel model,
+ boolean skipIrrelevants) {
+ fIterator = model.getAnnotationIterator();
+ fSkipIrrelevants = skipIrrelevants;
skip();
}
-
+
private void skip() {
while (fIterator.hasNext()) {
- Object next= fIterator.next();
+ Object next = fIterator.next();
if (next instanceof IProblemAnnotation) {
- IProblemAnnotation a= (IProblemAnnotation) next;
+ IProblemAnnotation a = (IProblemAnnotation) next;
if (fSkipIrrelevants) {
if (a.isRelevant()) {
- fNext= a;
+ fNext = a;
return;
}
} else {
- fNext= a;
+ fNext = a;
return;
}
}
}
- fNext= null;
+ fNext = null;
}
-
+
/*
* @see Iterator#hasNext()
*/