biz.hammurapi.metrics.persistent
Class AbstractPeriod

java.lang.Object
  extended by biz.hammurapi.metrics.persistent.AbstractPeriod
All Implemented Interfaces:
biz.hammurapi.util.Visitable, biz.hammurapi.xml.dom.DomSerializable
Direct Known Subclasses:
Period, SyntheticPeriod

public abstract class AbstractPeriod
extends java.lang.Object
implements biz.hammurapi.xml.dom.DomSerializable, biz.hammurapi.util.Visitable

Author:
Pavel Vlasov

Field Summary
protected  PeriodFactory factory
           
protected  java.lang.String name
           
protected  biz.hammurapi.metrics.persistent.Slice[] slices
           
protected  long timeFrom
           
protected  long timeTo
           
 
Constructor Summary
AbstractPeriod()
           
 
Method Summary
 boolean accept(biz.hammurapi.util.Visitor visitor)
           
protected  void aggregate(biz.hammurapi.metrics.persistent.Slice slice)
           
protected  void createSlices(int slices)
           
 double getDeviation()
           
 java.lang.String getLabel(int childId)
           
 long getLength()
           
 double getMaxValue()
           
 double getMeasurements()
           
 double getMinValue()
           
 java.lang.String getName()
           
 biz.hammurapi.metrics.persistent.Slice[] getSlices()
           
 java.util.Collection getSubCategories()
           
 long getTimeFrom()
           
 long getTimeTo()
           
 double getTotal()
           
protected abstract  void loadSubCategories(java.util.List subCategories)
          This method should add subcategories (of type Period) to this category.
protected  void normalizeSliceDeviations()
          Invoke after all aggregations.
protected  void setAttributes(org.w3c.dom.Element holder)
           
 void toDom(org.w3c.dom.Element holder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeFrom

protected long timeFrom

timeTo

protected long timeTo

slices

protected biz.hammurapi.metrics.persistent.Slice[] slices

factory

protected PeriodFactory factory

name

protected java.lang.String name
Constructor Detail

AbstractPeriod

public AbstractPeriod()
Method Detail

getDeviation

public double getDeviation()
Returns:
Returns the deviation.

getTimeFrom

public long getTimeFrom()
Returns:
Returns the from.

getMaxValue

public double getMaxValue()
Returns:
Returns the maxValue.

getMeasurements

public double getMeasurements()
Returns:
Returns the measurements.

getMinValue

public double getMinValue()
Returns:
Returns the minValue.

getTimeTo

public long getTimeTo()
Returns:
Returns the to.

getTotal

public double getTotal()
Returns:
Returns the total.

getSlices

public biz.hammurapi.metrics.persistent.Slice[] getSlices()
Returns:
Returns the slices.

getSubCategories

public java.util.Collection getSubCategories()
                                      throws java.sql.SQLException
Throws:
java.sql.SQLException

loadSubCategories

protected abstract void loadSubCategories(java.util.List subCategories)
                                   throws java.sql.SQLException
This method should add subcategories (of type Period) to this category.

Throws:
java.sql.SQLException

toDom

public void toDom(org.w3c.dom.Element holder)
Specified by:
toDom in interface biz.hammurapi.xml.dom.DomSerializable

getLabel

public java.lang.String getLabel(int childId)
Parameters:
childId -
Returns:

setAttributes

protected void setAttributes(org.w3c.dom.Element holder)
Parameters:
holder -

createSlices

protected void createSlices(int slices)
Parameters:
id -
slices -

aggregate

protected void aggregate(biz.hammurapi.metrics.persistent.Slice slice)
Parameters:
slice -

normalizeSliceDeviations

protected void normalizeSliceDeviations()
Invoke after all aggregations.


getLength

public long getLength()

accept

public boolean accept(biz.hammurapi.util.Visitor visitor)
Specified by:
accept in interface biz.hammurapi.util.Visitable

getName

public java.lang.String getName()
Returns:
Returns the name.


Copyright © 2006 Hammurapi Group. All Rights Reserved.