From 40d6beb82d8d9cfb196d5c0710c9ba9627cd7346 Mon Sep 17 00:00:00 2001 From: lioncash Date: Tue, 18 Mar 2014 07:45:05 -0400 Subject: [PATCH] Mark some utility classes as final. This makes sense, considering all that is provided is utility methods. --- gdx/src/com/badlogic/gdx/math/GeometryUtils.java | 2 +- gdx/src/com/badlogic/gdx/math/MathUtils.java | 2 +- gdx/src/com/badlogic/gdx/utils/BufferUtils.java | 2 +- gdx/src/com/badlogic/gdx/utils/NumberUtils.java | 2 +- gdx/src/com/badlogic/gdx/utils/ScreenUtils.java | 2 +- gdx/src/com/badlogic/gdx/utils/StreamUtils.java | 2 +- gdx/src/com/badlogic/gdx/utils/TimeUtils.java | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gdx/src/com/badlogic/gdx/math/GeometryUtils.java b/gdx/src/com/badlogic/gdx/math/GeometryUtils.java index fb4214b550b..b89b5f233e3 100644 --- a/gdx/src/com/badlogic/gdx/math/GeometryUtils.java +++ b/gdx/src/com/badlogic/gdx/math/GeometryUtils.java @@ -17,7 +17,7 @@ package com.badlogic.gdx.math; /** @author Nathan Sweet */ -public class GeometryUtils { +public final class GeometryUtils { static private final Vector2 tmp1 = new Vector2(), tmp2 = new Vector2(), tmp3 = new Vector2(); /** Computes the barycentric coordinates v,w for the specified point in the triangle. diff --git a/gdx/src/com/badlogic/gdx/math/MathUtils.java b/gdx/src/com/badlogic/gdx/math/MathUtils.java index e6ab6115b85..0a2d403d282 100644 --- a/gdx/src/com/badlogic/gdx/math/MathUtils.java +++ b/gdx/src/com/badlogic/gdx/math/MathUtils.java @@ -24,7 +24,7 @@ *

* Thanks to Riven on JavaGaming.org for the basis of sin/cos/atan2/floor/ceil. * @author Nathan Sweet */ -public class MathUtils { +public final class MathUtils { static public final float nanoToSec = 1 / 1000000000f; // --- diff --git a/gdx/src/com/badlogic/gdx/utils/BufferUtils.java b/gdx/src/com/badlogic/gdx/utils/BufferUtils.java index 587026c6b8f..30e979975ad 100644 --- a/gdx/src/com/badlogic/gdx/utils/BufferUtils.java +++ b/gdx/src/com/badlogic/gdx/utils/BufferUtils.java @@ -32,7 +32,7 @@ /** Class with static helper methods to increase the speed of array/direct buffer and direct buffer/direct buffer transfers * * @author mzechner, xoppa */ -public class BufferUtils { +public final class BufferUtils { static Array unsafeBuffers = new Array(); static int allocatedUnsafe = 0; diff --git a/gdx/src/com/badlogic/gdx/utils/NumberUtils.java b/gdx/src/com/badlogic/gdx/utils/NumberUtils.java index b76474219ee..fb5f9282f3a 100644 --- a/gdx/src/com/badlogic/gdx/utils/NumberUtils.java +++ b/gdx/src/com/badlogic/gdx/utils/NumberUtils.java @@ -16,7 +16,7 @@ package com.badlogic.gdx.utils; -public class NumberUtils { +public final class NumberUtils { /** When false, the mask in {@link #intToFloatColor(int)} will not be used. This must only be used when the resulting floats * will not be used with {@link #floatToIntColor(float)}. */ static public boolean intToFloatColorMask = true; diff --git a/gdx/src/com/badlogic/gdx/utils/ScreenUtils.java b/gdx/src/com/badlogic/gdx/utils/ScreenUtils.java index d75763704b7..23caec06acd 100644 --- a/gdx/src/com/badlogic/gdx/utils/ScreenUtils.java +++ b/gdx/src/com/badlogic/gdx/utils/ScreenUtils.java @@ -30,7 +30,7 @@ * entire screen content or a portion thereof. * * @author espitz */ -public class ScreenUtils { +public final class ScreenUtils { /** Returns the default framebuffer contents as a {@link TextureRegion} with a width and height equal to the current screen * size. The base {@link Texture} always has {@link MathUtils#nextPowerOfTwo} dimensions and RGBA8888 {@link Format}. It can be diff --git a/gdx/src/com/badlogic/gdx/utils/StreamUtils.java b/gdx/src/com/badlogic/gdx/utils/StreamUtils.java index a54e2fc671a..2cccfa3c8b1 100644 --- a/gdx/src/com/badlogic/gdx/utils/StreamUtils.java +++ b/gdx/src/com/badlogic/gdx/utils/StreamUtils.java @@ -26,7 +26,7 @@ import java.io.StringWriter; /** Provides utility methods to copy streams */ -public class StreamUtils { +public final class StreamUtils { public static final int DEFAULT_BUFFER_SIZE = 8192; public static final byte[] EMPTY_BYTES = new byte[0]; diff --git a/gdx/src/com/badlogic/gdx/utils/TimeUtils.java b/gdx/src/com/badlogic/gdx/utils/TimeUtils.java index 7013214d519..6b4774d0408 100644 --- a/gdx/src/com/badlogic/gdx/utils/TimeUtils.java +++ b/gdx/src/com/badlogic/gdx/utils/TimeUtils.java @@ -18,7 +18,7 @@ /** Wrapper around System.nanoTime() and System.currentTimeMillis(). Use this if you want to be compatible across all platforms! * @author mzechner */ -public class TimeUtils { +public final class TimeUtils { /** @return The current value of the system timer, in nanoseconds. */ public static long nanoTime () { return System.nanoTime();