Better entity code generation + minor refactoring
@@ -176,6 +176,17 @@ public class Array<T> implements Iterable<T>{
}
}
+ /** Iterates through the array and removes items if the consumer returns true. */
+ public void eachFilter(Boolf<? super T> consumer){
+ Iterator<T> it = iterator();
+ while(it.hasNext()){
+ T t = it.next();
+ if(consumer.get(t)){
+ it.remove();
+ }
+ }
+ }
+
/**Replaces values without creating a new array.*/
public void replace(Func<T, T> mapper){
for(int i = 0; i < size; i++){
