net.sf.jtreemap.swing
Class SplitByNumber

java.lang.Object
  extended by net.sf.jtreemap.swing.SplitStrategy
      extended by net.sf.jtreemap.swing.SplitByNumber
All Implemented Interfaces:
java.io.Serializable

public class SplitByNumber
extends SplitStrategy

Strategy who split the elements in 2 groups of same cardinal.

See Also:
Serialized Form
 

Constructor Summary
SplitByNumber()
           
 
Method Summary
 void splitElements(java.util.Vector<TreeMapNode> v, java.util.Vector<TreeMapNode> v1, java.util.Vector<TreeMapNode> v2)
          split the elements of a JTreeMap.
 double sumWeight(java.util.Vector<TreeMapNode> v)
          Sum the weight of elements.
 
Methods inherited from class net.sf.jtreemap.swing.SplitStrategy
calculatePositions, calculatePositionsRec, sortVector, workOutWeight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplitByNumber

public SplitByNumber()
Method Detail

splitElements

public void splitElements(java.util.Vector<TreeMapNode> v,
                          java.util.Vector<TreeMapNode> v1,
                          java.util.Vector<TreeMapNode> v2)
Description copied from class: SplitStrategy
split the elements of a JTreeMap.

Specified by:
splitElements in class SplitStrategy
Parameters:
v - Vector with the elements to split (arg IN)
v1 - first Vector of the split (arg OUT)
v2 - second Vector of the split (arg OUT)

sumWeight

public double sumWeight(java.util.Vector<TreeMapNode> v)
Description copied from class: SplitStrategy
Sum the weight of elements.
You can override this method if you want to apply a coef on the weights or to cancel the effect of weight on the strategy.

Overrides:
sumWeight in class SplitStrategy
Parameters:
v - Vector with the elements to sum
Returns:
the sum of the weight of elements