KeywordEnum: replace more String Keywords checks with Enums

This commit is contained in:
Hanmac
2018-05-10 11:53:41 +02:00
parent 91d80f49f4
commit 058aabb666
51 changed files with 553 additions and 447 deletions

View File

@@ -1,11 +1,22 @@
package forge.util;
public abstract class Visitor<T> {
/**
* visit the object
* the Visitor should return true it can be visit again
* returning false means the outer function can stop
*
* @param object
* @return boolean
*/
public abstract boolean visit(T object);
public void visitAll(Iterable<? extends T> objects) {
public boolean visitAll(Iterable<? extends T> objects) {
for (T obj : objects) {
visit(obj);
if (!visit(obj)) {
return false;
}
}
return true;
}
}