public class TaskSet extends 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,
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
|
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. |
String |
toHexString()
Convert the
TaskSet into a hex string representation. |
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, toByteArray, toLongArray, valueOf, valueOf, valueOf, valueOf, xor
public TaskSet()
public TaskSet(int ntasks)
0
through ntasks-1
. All tasks are initially
false
.ntasks
- the initial size of the task set.NegativeArraySizeException
- if the specified initial size is negative.public TaskSet(int ntasks, String str)
nbits
- number of tasks in the TaskSet
str
- hex string representation of tasks in the TaskSet
NegativeArraySizeException
- if the specified initial size is negative.public void clear(int[] indices) throws IndexOutOfBoundsException
indexes
- array of indices to clearIndexOutOfBoundsException
public TaskSet copy()
TaskSet
TaskSet
public void set(int[] indices) throws IndexOutOfBoundsException
indices
- array of indices to clearIndexOutOfBoundsException
public int[] toArray()
TaskSet
to an array containing the indices of all
tasks. If there are no tasks, an empty array is returned.public String toHexString()
TaskSet
into a hex string representation. The number
of characters in the string is always even.public 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.