net.logAnalyzer.analysis
Class LATimePeriod

java.lang.Object
  extended bynet.logAnalyzer.analysis.LATimePeriod
All Implemented Interfaces:
java.lang.Comparable

public class LATimePeriod
extends java.lang.Object
implements java.lang.Comparable

Used to set the time period of the analysis.

Version:
0.1
Author:
Karim REFEYTON

Field Summary
static LATimePeriod DAY
          1 day time period.
static LATimePeriod HOUR
          1 hour time period.
static LATimePeriod MINUTE
          1 minute time period.
static LATimePeriod MINUTES10
          10 minutes time period.
static LATimePeriod MINUTES30
          30 minutes time period.
static LATimePeriod MONTH
          1 month time period.
static LATimePeriod SECOND
          1 second time period.
static LATimePeriod WEEK
          1 week time period.
static LATimePeriod YEAR
          1 year time period.
 
Method Summary
 int compareTo(java.lang.Object anotherPeriod)
          Compare two periods.
 java.text.SimpleDateFormat getDateFormat()
          Return the date format.
 java.lang.String getName()
          Return the period name.
static LATimePeriod getPeriod(java.lang.String name)
          Return the period associated to the specified name.
 java.util.Date normalize(java.util.Date date)
          Normalize the specified date with current date format.
 java.lang.String normalizeToString(java.util.Date date)
          Format the specified date to String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECOND

public static final LATimePeriod SECOND
1 second time period.


MINUTE

public static final LATimePeriod MINUTE
1 minute time period.


MINUTES10

public static final LATimePeriod MINUTES10
10 minutes time period.


MINUTES30

public static final LATimePeriod MINUTES30
30 minutes time period.


HOUR

public static final LATimePeriod HOUR
1 hour time period.


DAY

public static final LATimePeriod DAY
1 day time period.


WEEK

public static final LATimePeriod WEEK
1 week time period.


MONTH

public static final LATimePeriod MONTH
1 month time period.


YEAR

public static final LATimePeriod YEAR
1 year time period.

Method Detail

getDateFormat

public java.text.SimpleDateFormat getDateFormat()
Return the date format.

Returns:
Date format.

getName

public java.lang.String getName()
Return the period name.

Returns:
Period name.

normalize

public java.util.Date normalize(java.util.Date date)
Normalize the specified date with current date format.

Parameters:
date - Date to normalize
Returns:
Normalized date.

normalizeToString

public java.lang.String normalizeToString(java.util.Date date)
Format the specified date to String.

Parameters:
date - Date to format
Returns:
Formatted date.

getPeriod

public static LATimePeriod getPeriod(java.lang.String name)
Return the period associated to the specified name.

Parameters:
name - Period name
Returns:
Period

compareTo

public int compareTo(java.lang.Object anotherPeriod)
Compare two periods. Return 0 if the current period is equal to the specified period; a value lower than 0 if the period is lower than the specified period; a value greater than 0 if the period is greater than the specified period.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
anotherPeriod - The period to be compared.
Returns:
0 if this equals the other period; < 0 if lower; > 0 if greater.
See Also:
Comparable.compareTo(java.lang.Object)


Copyright © 2006 null. All Rights Reserved.