public class TaskSet
extends java.util.BitSet
| Constructor and Description |
|---|
TaskSet()
Creates a new task set.
|
TaskSet(int ntasks)
Creates a task set whose initial size is large enough to explicitly
represent tasks with indices in the range
0 through ntasks-1. |
TaskSet(int ntasks,
java.lang.String str)
Construct a TaskSet and initialize from a hex string representation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear(int[] indices)
Clear the bits at each position given by the array of indices
|
java.lang.Object |
clone() |
TaskSet |
copy()
Create a copy of the
TaskSet |
void |
set(int[] indices)
Set the tasks at each position given by the array of indices
|
int |
taskSize()
Get the fixed number of tasks represented by the
TaskSet. |
int[] |
toArray()
Convert the
TaskSet to an array containing the indices of all
tasks. |
java.lang.String |
toHexString()
Convert the
TaskSet into a hex string representation. |
java.lang.String |
toString() |
and, andNot, cardinality, clear, clear, clear, equals, flip, flip, get, get, hashCode, intersects, isEmpty, length, nextClearBit, nextSetBit, or, previousClearBit, previousSetBit, set, set, set, set, size, stream, toByteArray, toLongArray, valueOf, valueOf, valueOf, valueOf, xorpublic TaskSet()
public TaskSet(int ntasks)
0 through ntasks-1. All tasks are initially
false.ntasks - the initial size of the task set.java.lang.NegativeArraySizeException - if the specified initial size is negative.public TaskSet(int ntasks,
java.lang.String str)
nbits - number of tasks in the TaskSetstr - hex string representation of tasks in the TaskSetjava.lang.NegativeArraySizeException - if the specified initial size is negative.public void clear(int[] indices)
throws java.lang.IndexOutOfBoundsException
indexes - array of indices to clearjava.lang.IndexOutOfBoundsExceptionpublic java.lang.Object clone()
clone in class java.util.BitSetpublic TaskSet copy()
TaskSetTaskSetpublic void set(int[] indices)
throws java.lang.IndexOutOfBoundsException
indices - array of indices to clearjava.lang.IndexOutOfBoundsExceptionpublic int[] toArray()
TaskSet to an array containing the indices of all
tasks. If there are no tasks, an empty array is returned.public java.lang.String toHexString()
TaskSet into a hex string representation. The number
of characters in the string is always even.public java.lang.String toString()
toString in class java.util.BitSetpublic int taskSize()
TaskSet. This
differs from BitSet.size() which is the number of bits of space used by
the TaskSet and BitSet.length() which is the index of the
highest bit plus one.Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.