Example usage for org.eclipse.jdt.internal.compiler.util ObjectVector copyInto

List of usage examples for org.eclipse.jdt.internal.compiler.util ObjectVector copyInto

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.util ObjectVector copyInto.

Prototype

public void copyInto(Object[] targetArray, int index) 

Source Link

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.search.matching.PossibleMatchSet.java

License:Open Source License

public PossibleMatch[] getPossibleMatches(IPackageFragmentRoot[] roots) {
    PossibleMatch[] result = new PossibleMatch[this.elementCount];
    int index = 0;
    for (int i = 0, length = roots.length; i < length; i++) {
        ObjectVector possibleMatches = (ObjectVector) this.rootsToPossibleMatches.get(roots[i].getPath());
        if (possibleMatches != null) {
            possibleMatches.copyInto(result, index);
            index += possibleMatches.size();
        }/*from   w  w  w .  j a  v  a2  s . co  m*/
    }
    if (index < this.elementCount)
        System.arraycopy(result, 0, result = new PossibleMatch[index], 0, index);
    return result;
}