net.sf.bloof.metrics
Class SqlMetric

java.lang.Object
  |
  +--net.sf.bloof.metrics.SqlMetric
All Implemented Interfaces:
Metric

public class SqlMetric
extends java.lang.Object
implements Metric

Metric wrapper for generic SQL queries provided by the user

Version:
$Id: SqlMetric.java,v 1.4 2003/10/13 15:52:31 pekacki Exp $
Author:
Lukasz Pekacki

Field Summary
 
Fields inherited from interface net.sf.bloof.metrics.Metric
XML_HEAD
 
Constructor Summary
SqlMetric()
          Default constructor
SqlMetric(MetricParameter aParams)
          Constructor containing parametes
 
Method Summary
 java.lang.String getDescription()
          Returns the description of the metric
 java.lang.String getName()
          Returns the Name of the metric
 MetricParameter getParameter()
          Returns the MetricParameter object of this metric
 javax.swing.JComponent getResultComponent()
          Returns a time line chart if there is one and only one time column, otherwise it returns a table
 net.n3.nanoxml.XMLElement getResultXml()
          Returns a time line element if there is one and only one time column, otherwise it returns a table element
 MetricParameter getSetup()
           
 javax.swing.JComponent getTitle()
          Create a title component for this metric
 void runMetric(Database aDatabase)
          Runs the metric
 void setName(java.lang.String aName)
           
 void setupMetric(MetricParameter aMetricParams)
          Initializes the metric with the specified parameter
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SqlMetric

public SqlMetric()
Default constructor


SqlMetric

public SqlMetric(MetricParameter aParams)
Constructor containing parametes

Parameters:
aParams - parameters for the metric
Method Detail

getDescription

public java.lang.String getDescription()
Description copied from interface: Metric
Returns the description of the metric

Specified by:
getDescription in interface Metric
Returns:
String description
See Also:
Metric.getDescription()

getName

public java.lang.String getName()
Description copied from interface: Metric
Returns the Name of the metric

Specified by:
getName in interface Metric
Returns:
String
See Also:
Metric.getName()

getParameter

public MetricParameter getParameter()
Description copied from interface: Metric
Returns the MetricParameter object of this metric

Specified by:
getParameter in interface Metric
Returns:
MetricParameter object of this metric, null if none parameters exist
See Also:
Metric.getParameter()

getResultComponent

public javax.swing.JComponent getResultComponent()
Returns a time line chart if there is one and only one time column, otherwise it returns a table

Specified by:
getResultComponent in interface Metric
Returns:
Component containing the results
See Also:
Metric.getResultComponent()

getResultXml

public net.n3.nanoxml.XMLElement getResultXml()
Returns a time line element if there is one and only one time column, otherwise it returns a table element

Specified by:
getResultXml in interface Metric
Returns:
XMLElement containing the results
See Also:
Metric.getResultXml()

getSetup

public MetricParameter getSetup()
See Also:
net.sf.bloof.metrics.Metric#getSetup()

getTitle

public javax.swing.JComponent getTitle()
Create a title component for this metric

Returns:
title component

runMetric

public void runMetric(Database aDatabase)
               throws java.sql.SQLException
Description copied from interface: Metric
Runs the metric

Specified by:
runMetric in interface Metric
Parameters:
aDatabase - Database for running the metric
Throws:
java.sql.SQLException - on database connection error
See Also:
net.sf.bloof.metrics.Metric#runMetric()

setName

public void setName(java.lang.String aName)
See Also:
net.sf.bloof.metrics.Metric#setName(java.lang.String)

setupMetric

public void setupMetric(MetricParameter aMetricParams)
Description copied from interface: Metric
Initializes the metric with the specified parameter

Specified by:
setupMetric in interface Metric
Parameters:
aMetricParams - parameter of the metrics
See Also:
Metric.setupMetric(net.sf.bloof.metrics.MetricParameter)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2003 bloof@Sourceforge. All Rights Reserved.