trove list
This commit is contained in:
parent
d83101854c
commit
c713ddee6d
@ -2,6 +2,7 @@ package com.baeldung.array;
|
|||||||
|
|
||||||
import com.google.common.primitives.ImmutableIntArray;
|
import com.google.common.primitives.ImmutableIntArray;
|
||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
|
import gnu.trove.list.TIntList;
|
||||||
import gnu.trove.list.array.TIntArrayList;
|
import gnu.trove.list.array.TIntArrayList;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -13,13 +14,16 @@ public class PrimitiveCollections {
|
|||||||
|
|
||||||
int[] primitives = new int[] {5, 10, 0, 2};
|
int[] primitives = new int[] {5, 10, 0, 2};
|
||||||
|
|
||||||
guavaPrimitives(primitives);
|
//guavaPrimitives(primitives);
|
||||||
|
|
||||||
trovePrimitives(primitives);
|
trovePrimitives(primitives);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void trovePrimitives(int[] primitives) {
|
private static void trovePrimitives(int[] primitives) {
|
||||||
TIntArrayList list = new TIntArrayList(primitives);
|
TIntList tList = new TIntArrayList(primitives);
|
||||||
|
tList.reverse();
|
||||||
|
System.out.println(tList);
|
||||||
|
System.out.println(tList.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void guavaPrimitives(int[] primitives) {
|
private static void guavaPrimitives(int[] primitives) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user