appl.parallel.data.splittable
Class SplittableLLProxyGrid

java.lang.Object
  extended by appl.data.LateLoadingProxy
      extended by appl.data.WritableGridLLProxy
          extended by appl.parallel.data.splittable.SplittableLLProxyGrid
All Implemented Interfaces:
DataProxy, DataPartition, SplittableGrid, SplittableResource, Serializable

public class SplittableLLProxyGrid
extends WritableGridLLProxy
implements SplittableGrid, Serializable

Version:
1.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class appl.data.WritableGridLLProxy
metaData
 
Fields inherited from class appl.data.LateLoadingProxy
baseObject, dataLoader, intialDataLoader, loaded, LOG
 
Constructor Summary
SplittableLLProxyGrid(ImportFactory importFac, RasterMetaData metaData, Object inputPara, XuluRegistry reg)
           
SplittableLLProxyGrid(RasterMetaData metaData, int id)
           
SplittableLLProxyGrid(WritableGridFactory targetFactory, RasterMetaData metaData)
           
 
Method Summary
 DataPartition getEmpty(int id)
          Creates an empty Object with the given id.
 DataLoader getLocalLoader()
          Returns the loader which is responible for loading the data.
 WritableGridPartition getPartition(Rectangle partitionBounds)
          Returns the partition specified by the given Rectangle.
 Rectangle getPartitionBounds()
          Returns the bounds of the partition as a rectangle.
 int getRootID()
          Should return a unique ID for this resource.
 int getSplitHeight()
           
 int getSplitWidth()
           
 void setPartition(DataPartition partition, Rectangle partitionBounds)
          Overwrites the data at the location specified by the Rectangle with the given partition-data.
 
Methods inherited from class appl.data.WritableGridLLProxy
convertRasterToReal, convertRealToRaster, dispose, getCellHeight, getCellWidth, getCoordinateReferenceSystem, getGridSample, getGridSampleAsByte, getGridSampleAsDouble, getGridSampleAsFloat, getGridSampleAsInt, getGridSampleAsLong, getGridSampleAsShort, getHeight, getMinX, getMinY, getRasterSample, getRasterSampleAsByte, getRasterSampleAsDouble, getRasterSampleAsFloat, getRasterSampleAsInt, getRasterSampleAsLong, getRasterSampleAsShort, getRealHeight, getRealWidth, getSampleType, getWidth, getX, getY, isLateLoadable, setGridSample, setRasterSample, tryLoadingGrid
 
Methods inherited from class appl.data.LateLoadingProxy
getProxiedObject, getUnloadFile, isLoaded, isUnloadingEnabled, loadData, setUnloadDir, setUnloading, unloadData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplittableLLProxyGrid

public SplittableLLProxyGrid(ImportFactory importFac,
                             RasterMetaData metaData,
                             Object inputPara,
                             XuluRegistry reg)

SplittableLLProxyGrid

public SplittableLLProxyGrid(WritableGridFactory targetFactory,
                             RasterMetaData metaData)

SplittableLLProxyGrid

public SplittableLLProxyGrid(RasterMetaData metaData,
                             int id)
Method Detail

getLocalLoader

public DataLoader getLocalLoader()
Description copied from interface: SplittableResource
Returns the loader which is responible for loading the data. This loader should be independet from the current system. This means that, e.g. for a loader which loads a grid from filesystem, that all paths should be relative (and not absolute), so that a possibly remote resource can load the data from its local filesystem, if the data is stored in the same position relative to the home directory.

Specified by:
getLocalLoader in interface SplittableResource
Returns:
a loader for this resource.

getRootID

public int getRootID()
Description copied from interface: SplittableResource
Should return a unique ID for this resource. Standard implementation would be returning the hashcode of the object.

Specified by:
getRootID in interface DataPartition
Specified by:
getRootID in interface SplittableResource
Returns:
a ID which is unique for this client

getPartition

public WritableGridPartition getPartition(Rectangle partitionBounds)
Description copied from interface: DataPartition
Returns the partition specified by the given Rectangle. Note, that partitioning by a rectangle does not mean, that the underlying datastructure has to be 2D, but only that the splitting has to be at max. 2D.

Specified by:
getPartition in interface DataPartition
Parameters:
partitionBounds - the bounds of the partition which are to be retrieved in global coordinates (the coordinates should be relative to the root-structure)

setPartition

public void setPartition(DataPartition partition,
                         Rectangle partitionBounds)
Overwrites the data at the location specified by the Rectangle with the given partition-data.

Specified by:
setPartition in interface DataPartition
Parameters:
partition - the grid to be inserted which MUST be an instance of WritableGrid!
partitionBounds - the target location of the data
See Also:
DataPartition.setPartition(DataPartition, java.awt.Rectangle)

getSplitHeight

public int getSplitHeight()
Specified by:
getSplitHeight in interface SplittableResource
Returns:
the splittable is splitted according to its splitHeight (example: the height of a raster)

getSplitWidth

public int getSplitWidth()
Specified by:
getSplitWidth in interface SplittableResource
Returns:
the splittable is splitted according to its splitWidth (example: the width of a raster or the length of an array)

getPartitionBounds

public Rectangle getPartitionBounds()
Description copied from interface: DataPartition
Returns the bounds of the partition as a rectangle. The coordinates of the rectangle are global (which means relative to the root structure).

Specified by:
getPartitionBounds in interface DataPartition
Returns:
the bounds of the partition as a rectangle. The coordinates of the rectangle are global (which means relative to the root structure).

getEmpty

public DataPartition getEmpty(int id)
Description copied from interface: DataPartition
Creates an empty Object with the given id. (Used e.g. by Multi-Data-Objects)

Specified by:
getEmpty in interface DataPartition
Parameters:
id - the id of the new Object
Returns:
an Empty element with the same dimension as this element.