public abstract class SplitStrategy extends Object implements Serializable
The split is done by dichotomy. We split the elements in 2 groups with a defined strategy (for example : take care of the weight of the elements)
| Constructor and Description |
|---|
SplitStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
calculatePositions(TreeMapNode root)
calculate the positions for all the elements of the root.
|
protected void |
calculatePositionsRec(int x0,
int y0,
int w0,
int h0,
double weight0,
List<TreeMapNode> v) |
protected void |
sortList(List<TreeMapNode> v)
Sort the elements by descending weight.
|
abstract void |
splitElements(List<TreeMapNode> v,
List<TreeMapNode> v1,
List<TreeMapNode> v2)
split the elements of a JTreeMap.
|
double |
sumWeight(List<TreeMapNode> v)
Sum the weight of elements.
|
protected void |
workOutWeight(List<TreeMapNode> v1,
List<TreeMapNode> v2,
List<TreeMapNode> vClone,
double sumWeight) |
public void calculatePositions(TreeMapNode root)
root - the root to calculatepublic abstract void splitElements(List<TreeMapNode> v, List<TreeMapNode> v1, List<TreeMapNode> v2)
v - List with the elements to split (arg IN)v1 - first List of the split (arg OUT)v2 - second List of the split (arg OUT)public double sumWeight(List<TreeMapNode> v)
v - List with the elements to sumprotected void calculatePositionsRec(int x0,
int y0,
int w0,
int h0,
double weight0,
List<TreeMapNode> v)
protected void sortList(List<TreeMapNode> v)
v - List with the elements to be sortedprotected void workOutWeight(List<TreeMapNode> v1, List<TreeMapNode> v2, List<TreeMapNode> vClone, double sumWeight)
Copyright © 2005–2019 Appendium - Portfolio Financing Platform. All rights reserved.