| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
java.lang.Object | +--ncsa.horizon.arrayND.ArrayChunk
Here's an example of how one might copy a chunk of data into a 1-D array:
ArrayChunk chunk;
Object out; // the 1-D output array
...
int i, j;
for(i=chunk.begin(), j=0; i != chunk.end(); i += chunk.stride(), j++)
Array.set( out, j, Array.get(chunk.array(), i) );
| Field Summary | |
| java.lang.Object | data
the reference to a 1-D array containing the chunk of interest |
| int | jump
the stride necessary to iterate through the chunk of interest |
| int | past
the position just after the last value in the chunk of interest |
| int | start
the starting postition within data of the chunk of interest |
| Constructor Summary | |
| ArrayChunk(int strt,
int lim,
int step,
java.lang.Object ary)
identify a chunk of data within a 1-D array. |
|
| ArrayChunk(java.lang.Object ary,
int strt,
int count)
identify a chunk of data within a 1-D array. |
|
| ArrayChunk(java.lang.Object ary,
int strt,
int count,
int step)
identify a chunk of data within a 1-D array. |
|
| ArrayChunk()
a no-arg constructor for use by subclasses only |
|
| Method Summary | |
| int | begin()
return the index to the first value in the chunk |
| java.lang.Object | data()
return a reference to the 1-D array holding the chunk |
| int | end()
return the index to the first value in the chunk |
| int | getCount()
return the number of values in the chunk of interest |
| int | stride()
return the index to the first value in the chunk |
| Methods inherited from class java.lang.Object | |
| clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait | |
| Field Detail |
protected java.lang.Object data
protected int start
protected int past
protected int jump
| Constructor Detail |
public ArrayChunk(int strt,
int lim,
int step,
java.lang.Object ary)
throws java.lang.IllegalArgumentException,
java.lang.ArrayIndexOutOfBoundsException
strt
- the positition of the first value in the chunk
of interest
lim
- a position just after the last value in the chunk.
This value can actually be any value within
the range (last, last+stride].
step
- the stride necessary to iterate through each value
of the chunk.
ary
- a 1-D array containing the chunck of interest
public ArrayChunk(java.lang.Object ary,
int strt,
int count)
throws java.lang.IllegalArgumentException,
java.lang.ArrayIndexOutOfBoundsException
ary
- a 1-D array containing the chunck of interest
strt
- the positition of the first value in the chunk
of interest
count
- the number of values in the chunk.
public ArrayChunk(java.lang.Object ary,
int strt,
int count,
int step)
throws java.lang.IllegalArgumentException,
java.lang.ArrayIndexOutOfBoundsException
ary
- a 1-D array containing the chunck of interest
strt
- the positition of the first value in the chunk
of interest
count
- the number of values in the chunk.
step
- the stride necessary to iterate through each value
of the chunk.protected ArrayChunk()
| Method Detail |
public final int begin()
public final int end()
public final int stride()
public final java.lang.Object data()
public final int getCount()
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||