net.sf.bloof.metrics
Class MetricParameter

java.lang.Object
  |
  +--net.sf.bloof.metrics.MetricParameter

public class MetricParameter
extends java.lang.Object

Container class that encapsulates the parameters that can be applied to metrics

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

Field Summary
static java.lang.String PARAM_DEVELOPER_GROUP
          Keys for the default filters for file, developers and time span
static java.lang.String PARAM_FILE_GROUP
          Keys for the default filters for file, developers and time span
static java.lang.String PARAM_TIME_SPAN
          Keys for the default filters for file, developers and time span
 
Constructor Summary
MetricParameter(DeveloperGroup aDevelopers, TimeInterval aTimeInterval, FileGroup aFileGroup)
          Constructs a MetricParameter object
MetricParameter(java.util.HashMap aParams)
          Constructs a MetricParameter object from a HashMap of parameters.
MetricParameter(java.lang.String aSqlQuery)
          Special constructor for the SQL query metric
 
Method Summary
 void addParams(java.lang.Object aKey, java.lang.Object aValue)
          Add a key-value pair to the params list
 DeveloperGroup getDevelopers()
          Returns the developers.
 FileGroup getFileNames()
          Returns an Iterator over all filenames specified in this parameter
 java.util.Iterator getKeys()
          Returns an iterator on the key set of generic key-value parameters
 java.lang.Object getParameter(java.lang.String aKey)
          Returns the parameter for the specified key.
 java.lang.String getSqlQuery()
           
 TimeInterval getTimeInterval()
          Returns the timeInterval.
 boolean hasDeveloperFilter()
          Checks if the Parameter contains a developer filter
 boolean hasFileFilter()
          Checks if the Parameter contains a file interval
 boolean hasTimeInterval()
          Checks if the Parameter contains a time interval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_FILE_GROUP

public static final java.lang.String PARAM_FILE_GROUP
Keys for the default filters for file, developers and time span

See Also:
Constant Field Values

PARAM_DEVELOPER_GROUP

public static final java.lang.String PARAM_DEVELOPER_GROUP
Keys for the default filters for file, developers and time span

See Also:
Constant Field Values

PARAM_TIME_SPAN

public static final java.lang.String PARAM_TIME_SPAN
Keys for the default filters for file, developers and time span

See Also:
Constant Field Values
Constructor Detail

MetricParameter

public MetricParameter(DeveloperGroup aDevelopers,
                       TimeInterval aTimeInterval,
                       FileGroup aFileGroup)
Constructs a MetricParameter object

Parameters:
aDevelopers - list of developers; use null if all developers should be included
aTimeInterval - interval for metric; use null if the whole timespan should be included
aFileGroup - fileGroups to include; use null if all files should be included

MetricParameter

public MetricParameter(java.util.HashMap aParams)
Constructs a MetricParameter object from a HashMap of parameters. For the default Bloof filters, use the following keys: PARAM_FILE_GROUP, PARAM_DEVELOPER_GROUP, PARAM_TIME_SPAN

Parameters:
aParams - HashMap containing the parameters of this object

MetricParameter

public MetricParameter(java.lang.String aSqlQuery)
Special constructor for the SQL query metric

Parameters:
aSqlQuery - SQL query
Method Detail

addParams

public void addParams(java.lang.Object aKey,
                      java.lang.Object aValue)
Add a key-value pair to the params list

Parameters:
aKey - key of the new pair
aValue - value of the new pair

getDevelopers

public DeveloperGroup getDevelopers()
Returns the developers.

Returns:
DeveloperGroup

getFileNames

public FileGroup getFileNames()
Returns an Iterator over all filenames specified in this parameter

Returns:
Iterator over all filenames specified in this parameter

getKeys

public java.util.Iterator getKeys()
Returns an iterator on the key set of generic key-value parameters

Returns:
iterator on the key set of generic key-value parameters, null if no key-value parameters are present

getParameter

public java.lang.Object getParameter(java.lang.String aKey)
Returns the parameter for the specified key.

Parameters:
aKey - key to use.
Returns:
parameter to this key. If not found, returns null.

getSqlQuery

public java.lang.String getSqlQuery()
Returns:
SQL query

getTimeInterval

public TimeInterval getTimeInterval()
Returns the timeInterval.

Returns:
TimeInterval

hasDeveloperFilter

public boolean hasDeveloperFilter()
Checks if the Parameter contains a developer filter

Returns:
boolean

hasFileFilter

public boolean hasFileFilter()
Checks if the Parameter contains a file interval

Returns:
boolean

hasTimeInterval

public boolean hasTimeInterval()
Checks if the Parameter contains a time interval

Returns:
boolean


Copyright © 2003 bloof@Sourceforge. All Rights Reserved.