Treeviz 0.37 2010-10-17

ch.randelshofer.tree.demo
Class LastModifiedWeighter

java.lang.Object
  extended by ch.randelshofer.tree.demo.LastModifiedWeighter
All Implemented Interfaces:
Weighter
Direct Known Subclasses:
LastModifiedByYearWeighter

public class LastModifiedWeighter
extends java.lang.Object
implements Weighter

LastModifiedWeighter.

Version:
2.0 2008-01-27 Added computation and drawing of histogram.
1.0 September 26, 2007 Created.
Author:
Werner Randelshofer

Field Summary
protected  int[] histogram
           
protected static java.text.NumberFormat intFormat
           
protected  long max
           
protected  long median
           
protected  long min
           
protected static FileSizeFormat shortWeightFormat
           
 
Constructor Summary
LastModifiedWeighter()
          Creates a new instance.
 
Method Summary
protected  void collectDatesRecursive(TreeNode node, java.util.List<java.lang.Long> dates)
           
 int[] getHistogram()
           
 java.lang.String getHistogramLabel_old(int index)
           
 java.lang.String getHistogramLabel(int index)
           
 java.lang.String getMaximumWeightLabel()
           
 float getMedianWeight()
           
 java.lang.String getMinimumWeightLabel()
           
 float getWeight(TreePath2 path)
           
protected  void histogramRecursive(TreeNode root)
           
 void init(TreeNode root)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

min

protected long min

max

protected long max

median

protected long median

histogram

protected int[] histogram

shortWeightFormat

protected static FileSizeFormat shortWeightFormat

intFormat

protected static java.text.NumberFormat intFormat
Constructor Detail

LastModifiedWeighter

public LastModifiedWeighter()
Creates a new instance.

Method Detail

getWeight

public float getWeight(TreePath2 path)
Specified by:
getWeight in interface Weighter

getMedianWeight

public float getMedianWeight()
Specified by:
getMedianWeight in interface Weighter

init

public void init(TreeNode root)
Specified by:
init in interface Weighter

collectDatesRecursive

protected void collectDatesRecursive(TreeNode node,
                                     java.util.List<java.lang.Long> dates)

histogramRecursive

protected void histogramRecursive(TreeNode root)

getHistogram

public int[] getHistogram()
Specified by:
getHistogram in interface Weighter

getMinimumWeightLabel

public java.lang.String getMinimumWeightLabel()
Specified by:
getMinimumWeightLabel in interface Weighter

getMaximumWeightLabel

public java.lang.String getMaximumWeightLabel()
Specified by:
getMaximumWeightLabel in interface Weighter

getHistogramLabel_old

public java.lang.String getHistogramLabel_old(int index)

getHistogramLabel

public java.lang.String getHistogramLabel(int index)
Specified by:
getHistogramLabel in interface Weighter

Copyright 2007-2008 (c) Werner Randelshofer.
All rights reserved.