public class ParallelArray
extends java.lang.Object
ParallelArray.Channel and are represented by ParallelArray.ChannelDescriptor. It's not necessary to store primitive
types in the channels but doing so will "exploit" data locality in the JVM, which is ensured for primitive types. Use
ParallelArray.FloatChannel, ParallelArray.IntChannel, ParallelArray.ObjectChannel to store the data.| Modifier and Type | Class and Description |
|---|---|
class |
ParallelArray.Channel
This class represents a container of values for all the elements for a given property
|
static class |
ParallelArray.ChannelDescriptor
This class describes the content of a
ParallelArray.Channel |
static interface |
ParallelArray.ChannelInitializer<T extends ParallelArray.Channel>
This interface is used to provide custom initialization of the
ParallelArray.Channel data |
class |
ParallelArray.FloatChannel |
class |
ParallelArray.IntChannel |
class |
ParallelArray.ObjectChannel<T> |
| Modifier and Type | Field and Description |
|---|---|
int |
capacity
the maximum amount of elements that this array can hold
|
int |
size
the current amount of defined elements, do not change manually unless you know what you are doing.
|
| Constructor and Description |
|---|
ParallelArray(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
<T extends ParallelArray.Channel> |
addChannel(ParallelArray.ChannelDescriptor channelDescriptor)
Adds and returns a channel described by the channel descriptor parameter.
|
<T extends ParallelArray.Channel> |
addChannel(ParallelArray.ChannelDescriptor channelDescriptor,
ParallelArray.ChannelInitializer<T> initializer)
Adds and returns a channel described by the channel descriptor parameter.
|
void |
addElement(java.lang.Object... values)
Adds an element considering the values in the same order as the current channels in the array.
|
void |
clear()
Removes all the channels and sets size to 0
|
<T extends ParallelArray.Channel> |
getChannel(ParallelArray.ChannelDescriptor descriptor) |
<T> void |
removeArray(int id)
Removes the channel with the given id
|
void |
removeElement(int index)
Removes the element at the given index and swaps it with the last available element
|
void |
setCapacity(int requiredCapacity)
Sets the capacity.
|
public int capacity
public int size
public <T extends ParallelArray.Channel> T addChannel(ParallelArray.ChannelDescriptor channelDescriptor)
public <T extends ParallelArray.Channel> T addChannel(ParallelArray.ChannelDescriptor channelDescriptor, ParallelArray.ChannelInitializer<T> initializer)
public <T> void removeArray(int id)
public void addElement(java.lang.Object... values)
public void removeElement(int index)
public <T extends ParallelArray.Channel> T getChannel(ParallelArray.ChannelDescriptor descriptor)
public void clear()
public void setCapacity(int requiredCapacity)