0
votes

I have commons-primitives-1.0.jar added as external executable jar on my eclipse.
So i am able to import org.apache.commons.collections.primitives.ArrayUnsignedShortList;

and I have a function

private void start() {

    _nexts = new ArrayList(_iterators.size());

    for (int i = 0, m = _iterators.size(); i < m; i++) {
        _nexts.add(null);
    }
    _nextSet = new BitSet(_iterators.size());
    _prevFrom = new ArrayUnsignedShortList(); < ---give me error here
}

it says,

The constructor ArrayUnsignedShortList() is not visible

I am not quite sure how to go about fixing this error because when i looked at the ArraysUnsignedShortList.java, it does have constructor.

Help?

http://commons.apache.org/proper/commons-primitives/apidocs/org/apache/commons/collections/primitives/ArrayUnsignedShortList.html

public ArrayUnsignedShortList() Construct an empty list with the default initial capacity.

^ so i should be able to call it..

2
@rkosegi It is, according to the documentation. - Paul Bellora
Not necessarily related, but what's the declared type of _prevFrom? - Paul Bellora
@Paul, that documentation says the constructor is public. So he should be able to use it. - Ravi Trivedi
@RaviTrivedi You're wrong - the constructor is public, so he shouldn't be disallowed from using it. - Paul Bellora
@Pual, LOL, that is what my comment says. - Ravi Trivedi

2 Answers

0
votes

It should work fine, unsure you have the correct library, with the correct import, and that nothing can interfere in your code :

If using Maven :

<dependency>
    <groupId>commons-primitives</groupId>
    <artifactId>commons-primitives</artifactId>
    <version>1.0</version>
</dependency>

Import :

import org.apache.commons.collections.primitives.ArrayUnsignedShortList;

Code :

ArrayUnsignedShortList myArray = new ArrayUnsignedShortList();
0
votes

Download Jar from here

Import the jar to your project and use this ,, Working fine.

ArrayUnsignedShortList obj = new ArrayUnsignedShortList();