| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.unh.sdb.datasource.DSStencil
edu.unh.sdb.datasource.DSPartitionedStencil
edu.unh.sdb.datasource.DSArrayStencil
public class DSArrayStencil
This is an implementation of a partitioned stencil that uses an array to maintain the record of active elements. As a result, the set and get methods are extremely fast, but iteration might be a little less efficient than the list implementation. However, it does not tax the garbage collector, so it may be more appropriate for repeated use.
| Field Summary | |
|---|---|
protected  DataBlock | 
block
 | 
protected  int | 
dataBytesUsed
 | 
protected  boolean[] | 
inStencil
 | 
protected  int | 
lastActiveOffset
 | 
protected  int | 
lastIndexRequested
 | 
protected  int | 
size
 | 
| Fields inherited from class edu.unh.sdb.datasource.DSPartitionedStencil | 
|---|
headerLength, partitioning, partitioningDimensionsArray, partitionListBytesLength | 
| Fields inherited from class edu.unh.sdb.datasource.DSStencil | 
|---|
dimensionality, space | 
| Constructor Summary | |
|---|---|
DSArrayStencil(RegularISPartitioning partitioning)
Construct a stencil that identifies areas of interest using a partitioning.  | 
|
| Method Summary | |
|---|---|
 void | 
clear()
Clear this stencil of all elements.  | 
 boolean | 
get(IndexSpaceID id)
Return true if the given id maps to an active stencil element, false otherwise.  | 
 byte[] | 
getData(byte[] data,
        DataSource ds)
Fill the given byte array with the data contained in the active elements of this stencil.  | 
 byte[] | 
getData(byte[] data,
        PointOrderBFDS ds)
Fill the given byte array with the data contained in the active elements of this stencil.  | 
 int | 
getDataBytesUsed()
Return the number of bytes actually used in the last call to getData().  | 
 ISBounds | 
getIndexedBounds(ISBounds stencilBounds,
                 int index)
Sets the argument ISBounds to the bounds of the specified stencil element.  | 
protected  long | 
getIndexedOffset(int index)
Return the partition offset corresponding to the given index.  | 
static void | 
main(java.lang.String[] argv)
 | 
 boolean | 
set(IndexSpaceID id)
Set the stencil element containing the id to "active".  | 
 boolean | 
setElement(IndexSpaceID pid)
Set the stencil element with index corresponding to id to "active.  | 
protected  void | 
setElementFromOffset(int offset)
Set the element corresponding to the 1D offset to be active.  | 
 int | 
size()
return number of active elements contained by this stencil  | 
 java.lang.String | 
toString()
Return a String representing the object.  | 
 java.lang.String | 
toString(java.lang.String indent)
 | 
| Methods inherited from class edu.unh.sdb.datasource.DSPartitionedStencil | 
|---|
chooseBytesPerValue, getPartitionDimensions, getPartitionDimensionsArray, getPartitioningDimensions, getPartitionListBytes, getPartitionListBytesLength, inPartitioningBounds, inPartitioningBounds, partitionVolume, setPartitionListFromBytes, volume | 
| Methods inherited from class edu.unh.sdb.datasource.DSStencil | 
|---|
dim, getIndexedBounds, getSpaceBounds | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
protected boolean[] inStencil
protected int size
protected int lastIndexRequested
protected int lastActiveOffset
protected int dataBytesUsed
protected DataBlock block
| Constructor Detail | 
|---|
public DSArrayStencil(RegularISPartitioning partitioning)
| Method Detail | 
|---|
public byte[] getData(byte[] data,
                      PointOrderBFDS ds)
public byte[] getData(byte[] data,
                      DataSource ds)
public int getDataBytesUsed()
public boolean set(IndexSpaceID id)
set in class DSStencilpublic boolean setElement(IndexSpaceID pid)
setElement in class DSStencilpublic boolean get(IndexSpaceID id)
get in class DSStencil
public ISBounds getIndexedBounds(ISBounds stencilBounds,
                                 int index)
getIndexedBounds in class DSStencilprotected final long getIndexedOffset(int index)
getIndexedOffset in class DSPartitionedStencilprotected void setElementFromOffset(int offset)
setElementFromOffset in class DSPartitionedStencilpublic int size()
size in class DSStencilpublic void clear()
clear in class DSPartitionedStencilpublic java.lang.String toString()
toString in class DSPartitionedStencilpublic java.lang.String toString(java.lang.String indent)
toString in class DSPartitionedStencilpublic static void main(java.lang.String[] argv)
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||