PCJ API
Version 1.2

bak.pcj.benchmark
Class DataSet

java.lang.Object
  extended bybak.pcj.benchmark.DataSet
Direct Known Subclasses:
DataSetOrderedCompact, DataSetShuffledCompact

public abstract class DataSet
extends Object

This class represents data sets for benchmarks. A data set contains three lists of equal length. Each list has only distinct values and the lists are all disjoint.

Since:
1.0

Constructor Summary
protected DataSet(String id, int size)
          Creates a new data set with a specified id and size.
 
Method Summary
protected abstract  int[] createList(int n, int size)
          Creates the list with the specified number.
 int[] get(int n)
          Returns a specified list of this data set.
 String getId()
          Returns an identifier for this data set.
 Integer[] getObjects(int n)
          Returns a specified list of this data set as objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSet

protected DataSet(String id,
                  int size)
Creates a new data set with a specified id and size.

Parameters:
id - the identifier of the new data set. Only used for formatting a report.
size - the size of the lists in the new data set.
Throws:
NullPointerException - if id is null.
IllegalArgumentException - if size is not positive.
Method Detail

get

public int[] get(int n)
Returns a specified list of this data set.

Parameters:
n - the index of the list to return.
Throws:
IndexOutOfBoundsException - if n is negative or greater than 2.

getObjects

public Integer[] getObjects(int n)
Returns a specified list of this data set as objects.

Parameters:
n - the index of the list to return.
Throws:
IndexOutOfBoundsException - if n is negative or greater than 2.

getId

public String getId()
Returns an identifier for this data set.

Returns:
an identifier for this data set.

createList

protected abstract int[] createList(int n,
                                    int size)
Creates the list with the specified number.

Parameters:
n - the number of the list to create (0-2).
size - the size of the list to create.
Returns:
data list number n with size size.

PCJ API
Version 1.2

Report a bug or request a feature.
Further information on the development and latest release of PCJ can be found at the project homepage.

Primitive Collections for Java is released under the GNU Lesser General Public License.
Copyright © 2002, 2003 Søren Bak. All Rights Reserved.

Hosted by SourceForge.net
SourceForge.net Logo