Questions tagged [apache-commons-collection]

Commons-Collections builds upon the Java collection classes by providing new interfaces, implementations and utilities.

Features listed from home page

  • Bag interface for collections that have a number of copies of each object
  • Buffer interface for collections that have a well defined removal order, like FIFOs
  • BidiMap interface for maps that can be looked up from value to key as well and key to value
  • MapIterator interface to provide simple and quick iteration over maps
  • Type checking decorators to ensure that only instances of a certain type can be added
  • Transforming decorators that alter each object as it is added to the collection
  • Composite collections that make multiple collections look like one
  • Ordered maps and sets that retain the order elements are added in, including an LRU based map
  • Identity map that compares objects based on their identity (==) instead of the equals method
  • Reference map that allows keys and/or values to be garbage collected under close control
  • Many comparator implementations
  • Many iterator implementations
  • Adapter classes from array and enumerations to collections
  • Utilities to test or create typical set-theory properties of collections such as union, intersection, and closure
74 questions
1
vote
1 answer

Why `floorEntry` and other methods are not accessible in PatriciaTrie?

While implementing an ip-lookup structure, I was trying to maintain a set of keys in a trie-like structure that allows me to search the "floor" of a key (that is, the largest key that is less or equal to a given key). I decided to use Apache…
ale64bit
  • 6,232
  • 3
  • 24
  • 44
1
vote
1 answer

Upgrading to commons-collections4 throws NoClassDefFoundError

I am upgrading the libraries in my pom of an older project and I have encountered a problem while upgrading from org.apache.commons commons-collections 3.2.1 to org.apache.commons commons-collections4 4.0. I know that it is not backwards compatible…
LisaMM
  • 675
  • 1
  • 16
  • 28
1
vote
1 answer

How to work with MultiValueMap

Currently I am writing a chat channel for my game. Players can create chat channels and others can join it. This is what I have so far but i do not know how to return the collection of players. MultiHashMap is deprecated and it told me to use…
1
vote
2 answers

Maven resolved commons-collections groupid as org.apache.commons.collections and can't find version 3.2.1

in my pom I have a dependency: commons-collections commons-collections 3.2.1 IMHO This is the correct dependency (compare…
seba.wagner
  • 3,800
  • 4
  • 28
  • 52
1
vote
2 answers

Apache CollectionUtils Performance

I was wandering if anyone made a benchmark on Apache CollectionUtils. In my simple benchmark: List ints = Arrays.asList(3, 4, 6, 7,8, 0,9,2, 5, 2,1, 35,11, 44, 5,1 ,2); long start = System.nanoTime(); ArrayList filtered =…
Noam Shaish
  • 1,613
  • 2
  • 16
  • 37
1
vote
1 answer

Java Servlet error - JasperReport (ClassNotFoundException: org.apache.commons.collections.ReferenceMap)

The Java/Servlets/JasperReports based application was working fine before, but now not showing the PDF report and throws java.lang.ClassNotFoundException I use the…
1
vote
3 answers

How to assign a common value for all fields of a Collection?

I have a POJO class called Employee with empName & Salary. I have a collection of Employee as a object with employee details. Now i want to reset the value of particular field to some common value. In this case i want to assign salary to "0" for all…
Karthikeyan
  • 506
  • 2
  • 8
  • 20
1
vote
1 answer

Ordered generic Map implementation?

Which library is the best with ordered map implementation? Implementation is required to be 1) generic 2) accessible by integer index One from JRE can't be accessed by index: http://docs.oracle.com/javase/7/docs/api/java/util/LinkedHashMap.html One…
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
0
votes
0 answers

"UnsupportedOperationException: Collision adding composited set with no SetMutator set" related to Apache collection4's CompositeMap

UnsupportedOperationException: Collision adding composited set with no SetMutator set is thrown when Spring reads the below configuration. According to the documentation of API CompositeMap, it looks like setMutator is to be set somewhere, but not…
J.E.Y
  • 1,173
  • 2
  • 15
  • 37
0
votes
1 answer

pom.xml file is showing these yellow color warnings in IntelliJIDEA while I can run the project just fine

I am using Appium 2.0.0-beta66, Java Client 8.5.0, node 18.xx, Selenium-java 4.9.1, Selenium Server 3.141.59, TestNG 7.7.1, and JDK 1.15.0-02, what is the next long term JDK I can go for ? BTW, I am seeing these yellow color highlights in pom.xml…
PraNuta
  • 629
  • 3
  • 12
  • 33
0
votes
2 answers

Using generics with jakarta commons collections Buffer

This code compiles fine in Java <= 1.4. Java 1.6 bitches and moans with the warning: "The method add(Object) belongs to the raw type Collection. References to generic type Collection should be parameterized" import…
user126593
  • 2,707
  • 4
  • 21
  • 16
0
votes
1 answer

Java - JSON Object and ListOrderedMap problem

I am trying to use the JSON-lib api in my code to convert a java object into a JSONObject. I have added all of the dependencies with the versions specified on the link below to my j2ee web module…
mh377
  • 1,656
  • 5
  • 22
  • 41
0
votes
1 answer

Maven transitive dependency - Commons Collection version 3 vs 4

I have such configuration in pom.xml: commons-beanutils commons-beanutils 1.9.4
jsosnowski
  • 1,560
  • 3
  • 26
  • 56
0
votes
0 answers

java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ReferenceMap error with commons-collections-2.1

My project used below mentions jars: commons-collections-2.1.jar myfaces-api-1.1.3.jar myfaces-impl-1.1.3.jar and jsf version 1.1 but getting this error: java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ReferenceMap and…
0
votes
4 answers

Java Random access Map

I'm looking for a opensource library that has an implementation of a random access map. I need a map that maintains its hash index but also indexes the values in insertion order like LinkedHashmap except you don't have to iterate through it to find…
AmanicA
  • 4,659
  • 1
  • 34
  • 49