net.sf.bloof.metrics
Class TimeInterval

java.lang.Object
  |
  +--net.sf.bloof.metrics.TimeInterval
All Implemented Interfaces:
Filter

public class TimeInterval
extends java.lang.Object
implements Filter

Represents a time interval. Acts as filter for a Metric This class is used as an argument for a @link{MetricParameter}

Version:
$Id: TimeInterval.java,v 1.10 2003/09/06 08:35:09 pekacki Exp $
Author:
Lukasz Pekacki

Field Summary
 
Fields inherited from interface net.sf.bloof.metrics.Filter
DEFAULT_NAME_PREFIXES, DEVELOPER, FILE, TIMESPAN
 
Constructor Summary
TimeInterval(java.util.Date aExactDate)
          Creates a TimeInterval that represents only one @link{Date}, precice to a millisecond
TimeInterval(java.util.Date aFrom, java.util.Date aTo)
          Creates a TimeInterval between the two specified @link{Date}s
TimeInterval(java.lang.String aName, java.util.Date aFrom, java.util.Date aTo)
          Creates a TimeInterval between the two specified @link{Date}s and sets its name
TimeInterval(TimeInterval[] aIntervals)
          Creates a TimeInterval on a list of Intervals
 
Method Summary
 java.lang.String getContent()
          Returns the content of the filter as string
 int getFilterType()
          Returns the type of the filter, must be one of Filter.FILE, Filter.DEVELOPER, Filter.TIMESPAN
 java.util.Date getFrom()
          Returns the from.
 java.lang.String getName()
          Returns the name.
 java.util.Date getTo()
          Returns the to.
 boolean isSingleDate()
          Checks if the Interval is empty and represents a single date
 void setName(java.lang.String aName)
          Sets the name.
 java.lang.String toString()
          (non-Javadoc)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeInterval

public TimeInterval(java.util.Date aExactDate)
Creates a TimeInterval that represents only one @link{Date}, precice to a millisecond

Parameters:
aExactDate - exact @link{Date} with Millisecond precision

TimeInterval

public TimeInterval(java.util.Date aFrom,
                    java.util.Date aTo)
Creates a TimeInterval between the two specified @link{Date}s

Parameters:
aFrom - interval starting @link{Date}
aTo - interval end @link{Date}

TimeInterval

public TimeInterval(java.lang.String aName,
                    java.util.Date aFrom,
                    java.util.Date aTo)
Creates a TimeInterval between the two specified @link{Date}s and sets its name

Parameters:
aName - name of the time interval
aFrom - interval starting @link{Date}
aTo - interval end @link{Date}

TimeInterval

public TimeInterval(TimeInterval[] aIntervals)
Creates a TimeInterval on a list of Intervals

Parameters:
aIntervals - interval list of Intervals
Method Detail

getContent

public java.lang.String getContent()
Description copied from interface: Filter
Returns the content of the filter as string

Specified by:
getContent in interface Filter
Returns:
name of the Filter
See Also:
Object.toString( )

getFilterType

public int getFilterType()
Description copied from interface: Filter
Returns the type of the filter, must be one of Filter.FILE, Filter.DEVELOPER, Filter.TIMESPAN

Specified by:
getFilterType in interface Filter
Returns:
type of the filter, must be one of Filter.FILE, Filter.DEVELOPER, Filter.TIMESPAN
See Also:
Filter.getFilterType()

getFrom

public java.util.Date getFrom()
Returns the from.

Returns:
Date

getName

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

Specified by:
getName in interface Filter
Returns:
String

getTo

public java.util.Date getTo()
Returns the to.

Returns:
Date

isSingleDate

public boolean isSingleDate()
Checks if the Interval is empty and represents a single date

Returns:
boolean

setName

public void setName(java.lang.String aName)
Sets the name.

Specified by:
setName in interface Filter
Parameters:
aName - The name to set

toString

public java.lang.String toString()
(non-Javadoc)

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


Copyright © 2003 bloof@Sourceforge. All Rights Reserved.