libgdx/libgdx — pull request #432 by javierj (2013-05-28 17:03:59+00:00)
Title: Partial refactor for Array class

I present a partial refactoring of the array class. RemoveAll method has been refactored to avid repeated code and I have added two new removeAll methods to indicate if using identity of equality.

I would like to apply the same refactoring for other method (like contains) as a first step to split the Array class into two new classes: ArrayIdentity and ArrayEquality. I guest is improbably using equality and identity over the same Array object.

Equality interface allows extracting the different code of the removeAll method.

I discovered a bug in Array:removeAll method. If identity is true, then the equals method is used. I have fixed that bug.

I have added docs for a couple of add method.

I have added the generic type to methods: addAll, Array constructor, removeAll and ArrayIterator fields.

Finally, I have added a new package structure for test cases with JUnit 4. I have included the test cases used for refactoring Array class.

Regards