Back to project page slider.
The source code is released under:
Apache License
If you think the Android project slider listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package de.devisnik.sliding.impl; // ww w. ja v a2s. com import java.util.ArrayList; import java.util.Iterator; import de.devisnik.sliding.IPiece; class PieceIterator implements Iterator<IPiece> { private int itsCurrent; private final ArrayList<IPiece> itsPieceList; public PieceIterator(final IPiece[][] pieces) { itsPieceList = new ArrayList<IPiece>(pieces.length*pieces[0].length); for (IPiece[] row : pieces) { for (IPiece piece : row) { itsPieceList.add(piece); } } itsCurrent = 0; } public boolean hasNext() { return itsCurrent < itsPieceList.size(); } public IPiece next() { IPiece value = itsPieceList.get(itsCurrent); itsCurrent++; return value; } public void remove() { throw new UnsupportedOperationException(); } }