com.jgraph.layout.hierarchical

Class JGraphCoordinateAssignment.WeightedCellSorter

protected class JGraphCoordinateAssignment.WeightedCellSorter extends Object implements Comparable

A utility class used to track cells whilst sorting occurs on the weighted sum of their connected edges. Does not violate (x.compareTo(y)==0) == (x.equals(y))
Field Summary
JGraphAbstractHierarchyCellcell
The cell whose median value is being calculated
booleannudge
Whether or not to flip equal weight values.
intrankIndex
The index this cell is in the model rank
booleanvisited
Whether or not this cell has been visited in the current assignment
intweightedValue
The weighted value of the cell stored
Constructor Summary
WeightedCellSorter()
WeightedCellSorter(JGraphAbstractHierarchyCell cell, int weightedValue)
Method Summary
intcompareTo(Object arg0)
comparator on the medianValue

Field Detail

cell

public JGraphAbstractHierarchyCell cell
The cell whose median value is being calculated

nudge

public boolean nudge
Whether or not to flip equal weight values.

rankIndex

public int rankIndex
The index this cell is in the model rank

visited

public boolean visited
Whether or not this cell has been visited in the current assignment

weightedValue

public int weightedValue
The weighted value of the cell stored

Constructor Detail

WeightedCellSorter

public WeightedCellSorter()

WeightedCellSorter

public WeightedCellSorter(JGraphAbstractHierarchyCell cell, int weightedValue)

Method Detail

compareTo

public int compareTo(Object arg0)
comparator on the medianValue

Parameters: arg0 the object to be compared to

Returns: the standard return you would expect when comparing two double

Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.