Starsector API
Loading...
Searching...
No Matches
SaveableIterator.java
Go to the documentation of this file.
1package com.fs.starfarer.api.util;
2
3import java.util.ArrayList;
4import java.util.Iterator;
5import java.util.List;
6
7public class SaveableIterator<T> implements Iterator<T>{
8
9 private List<T> list;
10 private int index;
12 this.list = new ArrayList<T>(list);
13 index = -1;
14 }
15
16 public boolean hasNext() {
17 return index + 1 < list.size();
18 }
19
20 public T next() {
21 index++;
22 return list.get(index);
23 }
24
25 public void remove() {
27 }
28}