Eclipse collections
Eclipse Collections is advance Java collection framework. It has some additional data structures and features which is not available in Java Collection Framework.
Eclipse Collections provides memory efficient implementation of Sets and Maps as well as primitive collections.
Maven Dependency:
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections-api</artifactId>
<version>9.2.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections</artifactId>
<version>9.2.0</version>
</dependency>
Comparison with Java
ArrayList ( JDK )
List<String> comparison = new ArrayList<String>();
comparison.add("Bangalore");
comparison.add("Ahmedabad");
comparison.add("Pune");
comparison.add("Pune");
Fast List ( Eclipse Collection)
MutableList<String> comparison = FastList.newListWith("Bangalore", "Ahmedabad", "Pune", "Pune");
Set<String> comparison = new HashSet<String>();
comparison.add("Bangalore");
comparison.add("Ahmedabad");
comparison.add("Pune");
comparison.add("Delhi");
Unified Set ( Eclipse Collection)
Set<String> comparison = UnifiedSet.newSetWith("Bangalore", "Ahmedabad", "Pune", "Delhi");
Map (JDK)
Map<Integer, String> map = new HashMap<Integer, String>();
map.put(1, "1");
map.put(2, "2");
map.put(3, "3");
Unified Map ( Eclipse Collection)
MutableMap<Integer, String> map = UnifiedMap.newWithKeysValues(1, "1", 2, "2", 3, "3");
Conclusion:
In this blog, I've tried to provide the similar Data structure of JDK and Eclipse Collection.
Comments
Post a Comment