Treeviz 0.37 2010-10-17

ch.randelshofer.tree.demo
Class TreevizFileSystemXMLInfoWeighter

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

public class TreevizFileSystemXMLInfoWeighter
extends java.lang.Object
implements Weighter

InfoWeighter.

Version:
1.0 23. Juni 2008 Created.
Author:
Werner Randelshofer

Field Summary
protected  int[] histogram
           
protected  TreevizFileSystemXMLNodeInfo info
           
protected static java.text.NumberFormat intFormat
           
protected  java.text.DateFormat isoDateFormatter
           
protected  java.text.DateFormat isoDateFormatter2
           
protected  java.lang.String key
           
protected  java.lang.Object max
           
protected  java.lang.Object median
           
protected  java.lang.Object min
           
protected static FileSizeFormat shortWeightFormat
           
protected  long[] size
           
protected  long[] sizeHistogram
           
protected  java.lang.String sizeKey
           
 
Constructor Summary
TreevizFileSystemXMLInfoWeighter(TreevizFileSystemXMLNodeInfo info, java.lang.String key)
          Creates a new instance.
TreevizFileSystemXMLInfoWeighter(TreevizFileSystemXMLNodeInfo info, java.lang.String key, java.lang.String sizeKey)
           
 
Method Summary
protected  void calculateDateHistogramRecursive(TreeNode root)
          Calculates the date histogram recursively.
protected  void collectDatesRecursive(TreevizFileSystemXMLNode node, java.util.List<java.util.Date> dates)
           
 int[] getHistogram()
           
 java.lang.String getHistogramLabel(int index)
           
 java.lang.String getMaximumWeightLabel()
           
 float getMedianWeight()
           
 java.lang.String getMinimumWeightLabel()
           
 float getWeight(TreePath2 path)
           
 void init(TreeNode root)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

info

protected TreevizFileSystemXMLNodeInfo info

key

protected java.lang.String key

sizeKey

protected java.lang.String sizeKey

histogram

protected int[] histogram

sizeHistogram

protected long[] sizeHistogram

size

protected long[] size

min

protected java.lang.Object min

max

protected java.lang.Object max

median

protected java.lang.Object median

isoDateFormatter

protected java.text.DateFormat isoDateFormatter

isoDateFormatter2

protected java.text.DateFormat isoDateFormatter2

shortWeightFormat

protected static FileSizeFormat shortWeightFormat

intFormat

protected static java.text.NumberFormat intFormat
Constructor Detail

TreevizFileSystemXMLInfoWeighter

public TreevizFileSystemXMLInfoWeighter(TreevizFileSystemXMLNodeInfo info,
                                        java.lang.String key)
Creates a new instance.


TreevizFileSystemXMLInfoWeighter

public TreevizFileSystemXMLInfoWeighter(TreevizFileSystemXMLNodeInfo info,
                                        java.lang.String key,
                                        java.lang.String sizeKey)
Method Detail

init

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

collectDatesRecursive

protected void collectDatesRecursive(TreevizFileSystemXMLNode node,
                                     java.util.List<java.util.Date> dates)

calculateDateHistogramRecursive

protected void calculateDateHistogramRecursive(TreeNode root)
Calculates the date histogram recursively.

Parameters:
root -

getWeight

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

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

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

getMedianWeight

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

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