org.opennms.core.utils
Class FuzzyDateFormatter

java.lang.Object
  extended by org.opennms.core.utils.FuzzyDateFormatter

public class FuzzyDateFormatter
extends Object

FuzzyDateFormatter class.

Version:
$Id: $
Author:
Benjamin Reed

Field Summary
static double MILLISECONDS_PER_DAY
          Constant MILLISECONDS_PER_DAY=86400000.0
static double MILLISECONDS_PER_HOUR
          Constant MILLISECONDS_PER_HOUR=3600000.0
static double MILLISECONDS_PER_MINUTE
          Constant MILLISECONDS_PER_MINUTE=60000.0
static double MILLISECONDS_PER_SECOND
          Constant MILLISECONDS_PER_SECOND=1000.0
 
Constructor Summary
FuzzyDateFormatter()
          Constructor for FuzzyDateFormatter.
 
Method Summary
static String calculateDifference(Date start, Date end)
          calculateDifference
protected static String formatNumber(Double number, String singular, String plural)
          formatNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MILLISECONDS_PER_SECOND

public static final double MILLISECONDS_PER_SECOND
Constant MILLISECONDS_PER_SECOND=1000.0

See Also:
Constant Field Values

MILLISECONDS_PER_DAY

public static final double MILLISECONDS_PER_DAY
Constant MILLISECONDS_PER_DAY=86400000.0

See Also:
Constant Field Values

MILLISECONDS_PER_HOUR

public static final double MILLISECONDS_PER_HOUR
Constant MILLISECONDS_PER_HOUR=3600000.0

See Also:
Constant Field Values

MILLISECONDS_PER_MINUTE

public static final double MILLISECONDS_PER_MINUTE
Constant MILLISECONDS_PER_MINUTE=60000.0

See Also:
Constant Field Values
Constructor Detail

FuzzyDateFormatter

public FuzzyDateFormatter()

Constructor for FuzzyDateFormatter.

Method Detail

formatNumber

protected static String formatNumber(Double number,
                                     String singular,
                                     String plural)

formatNumber

Parameters:
number - a Double object.
singular - a String object.
plural - a String object.
Returns:
a String object.

calculateDifference

public static String calculateDifference(Date start,
                                         Date end)

calculateDifference

Parameters:
start - a Date object.
end - a Date object.
Returns:
a String object.


Copyright © 2011. All Rights Reserved.