From: <sp...@us...> - 2011-07-13 12:44:31
|
Revision: 3583 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3583&view=rev Author: spasi Date: 2011-07-13 12:44:25 +0000 (Wed, 13 Jul 2011) Log Message: ----------- Made MappedForeach package private (foreach returns Iterable now) and changed next() to go through the bounds check. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java 2011-07-12 22:07:32 UTC (rev 3582) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedForeach.java 2011-07-13 12:44:25 UTC (rev 3583) @@ -38,7 +38,7 @@ * * @author Riven */ -public class MappedForeach<T extends MappedObject> implements Iterable<T> { +final class MappedForeach<T extends MappedObject> implements Iterable<T> { final T mapped; final int elementCount; @@ -58,8 +58,7 @@ } public T next() { - mapped.viewAddress = mapped.baseAddress + (this.index++) * mapped.stride; - + MappedHelper.put_view(mapped, this.index++); return mapped; } Modified: trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java 2011-07-12 22:07:32 UTC (rev 3582) +++ trunk/LWJGL/src/java/org/lwjgl/util/mapped/MappedObject.java 2011-07-13 12:44:25 UTC (rev 3583) @@ -214,7 +214,7 @@ * For convenience you are encouraged to static-import this specific method: * <code>import static org.lwjgl.util.mapped.MappedObject.foreach;</code> */ - public static <T extends MappedObject> MappedForeach<T> foreach(T mapped, int elementCount) { + public static <T extends MappedObject> Iterable<T> foreach(T mapped, int elementCount) { return new MappedForeach<T>(mapped, elementCount); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |