project: Injector and mixins
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
public class RuneLiteIterableLinkDeque implements Iterator<Link>
|
||||
{
|
||||
public final LinkDeque linkDeque;
|
||||
public Link link;
|
||||
|
||||
public RuneLiteIterableLinkDeque(LinkDeque linkDeque)
|
||||
{
|
||||
this.linkDeque = linkDeque;
|
||||
this.link = this.linkDeque.sentinel.previous;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext()
|
||||
{
|
||||
return this.link != this.linkDeque.sentinel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Link next()
|
||||
{
|
||||
if (this.link == this.linkDeque.sentinel)
|
||||
{
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
else
|
||||
{
|
||||
Link friendLoginUpdate = this.link;
|
||||
this.link = this.link.previous;
|
||||
|
||||
return friendLoginUpdate;
|
||||
}
|
||||
}
|
||||
|
||||
public void remove()
|
||||
{
|
||||
Link link = this.link.next;
|
||||
if (link == this.linkDeque.sentinel)
|
||||
{
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
else
|
||||
{
|
||||
link.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user