add sort (ascending) method
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.lucares.collections;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -249,6 +250,13 @@ public class IntList {
|
||||
return get(0, index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the list into ascending order.
|
||||
*/
|
||||
public void sort() {
|
||||
Arrays.sort(data, 0, index);
|
||||
}
|
||||
|
||||
private void ensureCapacity(final int newElements) {
|
||||
|
||||
final int requiredCapacity = index + newElements;
|
||||
|
||||
Reference in New Issue
Block a user