renamed MathUtils -> MathUtil

This commit is contained in:
nathan 2015-07-22 11:13:18 +02:00
parent 12f5e9c0ed
commit 5758e66ca8
4 changed files with 10 additions and 10 deletions

View File

@ -19,7 +19,7 @@ package dorkbox.util;
@SuppressWarnings("unused")
public
class MathUtils {
class MathUtil {
// ---

View File

@ -19,7 +19,7 @@
package dorkbox.util.collections;
import dorkbox.util.MathUtils;
import dorkbox.util.MathUtil;
import java.util.Arrays;
@ -291,7 +291,7 @@ public class IntArray {
public void shuffle () {
for (int i = this.size - 1; i >= 0; i--) {
int ii = MathUtils.randomInt(i);
int ii = MathUtil.randomInt(i);
int temp = this.items[i];
this.items[i] = this.items[ii];
this.items[ii] = temp;
@ -311,7 +311,7 @@ public class IntArray {
if (this.size == 0) {
return 0;
}
return this.items[MathUtils.randomInt(0, this.size - 1)];
return this.items[MathUtil.randomInt(0, this.size - 1)];
}
public int[] toArray () {

View File

@ -19,7 +19,7 @@
package dorkbox.util.collections;
import dorkbox.util.MathUtils;
import dorkbox.util.MathUtil;
import java.util.Iterator;
import java.util.NoSuchElementException;
@ -78,7 +78,7 @@ public class IntMap<V> {
if (this.capacity > 1 << 30) {
throw new IllegalArgumentException("initialCapacity is too large: " + initialCapacity);
}
this.capacity = MathUtils.nextPowerOfTwo(initialCapacity);
this.capacity = MathUtil.nextPowerOfTwo(initialCapacity);
if (loadFactor <= 0) {
throw new IllegalArgumentException("loadFactor must be > 0: " + loadFactor);
@ -237,7 +237,7 @@ public class IntMap<V> {
int i = 0, pushIterations = this.pushIterations;
do {
// Replace the key and value for one of the hashes.
switch (MathUtils.randomInt(2)) {
switch (MathUtil.randomInt(2)) {
case 0:
evictedKey = key1;
evictedValue = valueTable[index1];
@ -557,7 +557,7 @@ public class IntMap<V> {
public void ensureCapacity (int additionalCapacity) {
int sizeNeeded = this.size + additionalCapacity;
if (sizeNeeded >= this.threshold) {
resize(MathUtils.nextPowerOfTwo((int)(sizeNeeded / this.loadFactor)));
resize(MathUtil.nextPowerOfTwo((int) (sizeNeeded / this.loadFactor)));
}
}

View File

@ -16,7 +16,7 @@
package dorkbox.util.collections;
import com.esotericsoftware.kryo.util.ObjectMap;
import dorkbox.util.MathUtils;
import dorkbox.util.MathUtil;
/** An unordered map where the values are ints. This implementation is a cuckoo hash map using 3 hashes, random walking, and a
* small stash for problematic keys. Null keys are not allowed. No allocation is done except when growing the table size. <br>
@ -209,7 +209,7 @@ public class ObjectIntMap<K> {
int i = 0, pushIterations = this.pushIterations;
do {
// Replace the key and value for one of the hashes.
switch (MathUtils.randomInt(2)) {
switch (MathUtil.randomInt(2)) {
case 0:
evictedKey = key1;
evictedValue = valueTable[index1];