pick 97420a31d The big reformat of 2020

This commit is contained in:
yueh
2020-06-16 21:41:28 +02:00
parent 5304b3febe
commit 5225ea426b
2252 changed files with 95466 additions and 118582 deletions
@@ -18,58 +18,46 @@
package appeng.fluids.util;
import java.util.Iterator;
import java.util.NoSuchElementException;
import appeng.api.storage.data.IAEStack;
public class MeaningfulFluidIterator<T extends IAEStack> implements Iterator<T> {
public class MeaningfulFluidIterator<T extends IAEStack> implements Iterator<T>
{
private final Iterator<T> parent;
private T next;
private final Iterator<T> parent;
private T next;
public MeaningfulFluidIterator(final Iterator<T> iterator) {
this.parent = iterator;
}
public MeaningfulFluidIterator( final Iterator<T> iterator )
{
this.parent = iterator;
}
@Override
public boolean hasNext() {
while (this.parent.hasNext()) {
this.next = this.parent.next();
if (this.next.isMeaningful()) {
return true;
} else {
this.parent.remove(); // self cleaning :3
}
}
@Override
public boolean hasNext()
{
while( this.parent.hasNext() )
{
this.next = this.parent.next();
if( this.next.isMeaningful() )
{
return true;
}
else
{
this.parent.remove(); // self cleaning :3
}
}
this.next = null;
return false;
}
this.next = null;
return false;
}
@Override
public T next() {
if (this.next == null) {
throw new NoSuchElementException();
}
@Override
public T next()
{
if( this.next == null )
{
throw new NoSuchElementException();
}
return this.next;
}
return this.next;
}
@Override
public void remove()
{
this.parent.remove();
}
@Override
public void remove() {
this.parent.remove();
}
}