Skip to content

Commit

Permalink
fastutil code
Browse files Browse the repository at this point in the history
  • Loading branch information
MherBaghinyan committed Mar 10, 2019
1 parent b42c2d3 commit d03c218
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libraries/src/main/java/com/baeldung/primitives/PrimitiveMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import cern.colt.map.OpenIntDoubleHashMap;
import gnu.trove.map.TDoubleIntMap;
import gnu.trove.map.hash.TDoubleIntHashMap;
import it.unimi.dsi.fastutil.ints.*;
import org.eclipse.collections.api.map.primitive.*;
import org.eclipse.collections.impl.factory.primitive.*;

Expand All @@ -14,6 +15,17 @@ public static void main(String[] args) {
eclipseCollectionsMap();
troveMap();
coltMap();
fastutilMap();
}

private static void fastutilMap() {
Int2BooleanMap int2BooleanMap = new Int2BooleanOpenHashMap();
int2BooleanMap.put(1, true);

Int2BooleanSortedMap int2BooleanSorted = Int2BooleanSortedMaps.EMPTY_MAP;
int2BooleanSorted.putIfAbsent(7, true);
int2BooleanSorted.putIfAbsent(1, true);
int2BooleanSorted.putIfAbsent(4, true);
}

private static void coltMap() {
Expand Down

0 comments on commit d03c218

Please sign in to comment.