summaryrefslogtreecommitdiff
path: root/src/actors/scala/actors/threadpool/AbstractCollection.java
blob: 195a0064ab5c6ab3fa60551a416dfac09312d342 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Written by Dawid Kurzyniec, based on public domain code written by Doug Lea
 * and publicly available documentation, and released to the public domain, as
 * explained at http://creativecommons.org/licenses/publicdomain
 */

package scala.actors.threadpool;
import scala.actors.threadpool.helpers.Utils;

/**
 * Overrides toArray() and toArray(Object[]) in AbstractCollection to provide
 * implementations valid for concurrent collections.
 *
 * @author Doug Lea
 * @author Dawid Kurzyniec
 */
public abstract class AbstractCollection extends java.util.AbstractCollection {

    /**
     * Sole constructor. (For invocation by subclass constructors, typically
     * implicit.)
     */
    protected AbstractCollection() { super(); }

    public Object[] toArray() {
        return Utils.collectionToArray(this);
    }

    public Object[] toArray(Object[] a) {
        return Utils.collectionToArray(this, a);
    }
}