Back to project page RoboBinding-gallery.
The source code is released under:
Apache License
If you think the Android project RoboBinding-gallery 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 org.robobinding.gallery.util; /* ww w .j a v a2 s . co m*/ /** * * @since 1.0 * @version $Revision: 1.0 $ * @author Cheng Wei */ public class CircularIntegers { private int[] values; private int currentIndex; public CircularIntegers(int... values) { this.values = values; } public int start() { currentIndex = 0; return next(); } public int next() { int current = value(); currentIndex++; if(currentIndex >= values.length) { currentIndex = 0; } return current; } public int value() { return values[currentIndex]; } }