1 |
mojays |
2 |
package appl.parallel.spmd.split; |
2 |
|
|
|
3 |
|
|
import java.awt.Rectangle; |
4 |
|
|
|
5 |
|
|
/** |
6 |
|
|
* Represents a data partition. It has an id which identifies the resource, which is the mother |
7 |
|
|
* of the partition. |
8 |
|
|
* |
9 |
|
|
* @author Dominik Appl |
10 |
|
|
*/ |
11 |
|
|
public interface DataPartition { |
12 |
|
|
|
13 |
|
|
/** |
14 |
|
|
* Returns the id of the super data structure this partition is a part of. |
15 |
|
|
* @return the id of the super data structure this partition is a part of. |
16 |
|
|
*/ |
17 |
|
|
public int getRootID(); |
18 |
|
|
|
19 |
|
|
/** |
20 |
|
|
* Returns the bounds of the partition as a rectangle. The coordinates |
21 |
|
|
* of the rectangle are global (which means relative to the root structure). |
22 |
|
|
* @return the bounds of the partition as a rectangle. The coordinates |
23 |
|
|
* of the rectangle are global (which means relative to the root structure). |
24 |
|
|
*/ |
25 |
|
|
public Rectangle getPartitionBounds(); |
26 |
|
|
/** |
27 |
|
|
* Returns the partition specified by the given {@link Rectangle}. Note, that |
28 |
|
|
* partitioning by a rectangle does not mean, that the underlying datastructure |
29 |
|
|
* has to be 2D, but only that the splitting has to be at max. 2D. |
30 |
|
|
* @param partitionBounds the bounds of the partition which are to be retrieved |
31 |
|
|
* in global coordinates (the coordinates should be relative to the root-structure) |
32 |
|
|
*/ |
33 |
|
|
public DataPartition getPartition(Rectangle partitionBounds); |
34 |
|
|
|
35 |
|
|
/** |
36 |
|
|
* Overwrites the data at the location specified by the {@link Rectangle} with |
37 |
|
|
* the given partition-data. |
38 |
|
|
* |
39 |
|
|
* @param partition the new data |
40 |
|
|
* @param partitionBounds the target location of the data (in coordinates of the root structure) |
41 |
|
|
*/ |
42 |
|
|
public void setPartition(DataPartition partition, Rectangle partitionBounds); |
43 |
|
|
|
44 |
|
|
/** |
45 |
|
|
* Creates an empty Object with the given id. (Used e.g. by Multi-Data-Objects) |
46 |
|
|
* @param newID the id of the new Object |
47 |
|
|
* @return an Empty element with the same dimension as this element. |
48 |
|
|
*/ |
49 |
|
|
public DataPartition getEmpty(int newID); |
50 |
|
|
|
51 |
|
|
|
52 |
|
|
} |