org.opennms.bb.dp.eventd.db
Class Time
java.lang.Object
|
+--org.opennms.bb.dp.eventd.db.Time
- public final class Time
- extends Object
This class is designed to format time information
into the representation chosen for the events database
records. This format is defined as DD-MMM-YYYY HH:MM:SS,
where MMM is the first three lower case character letters of the month.
- Version:
- $Revision: 1.1 $
- Author:
- Brian Weaver, OpenNMS
Inner Class Summary |
private static class |
Time.pair
This class is designed to pair an integer value
with a string name. |
Field Summary |
private static Time.pair[] |
dateMap
The month values to name mapping! |
Constructor Summary |
Time()
|
Method Summary |
(package private) static void |
()
Load in the static date mappings |
static String |
format(Calendar c)
Format the time value in the DD-MMM-YYYY HH:MM:SS format. |
private static String |
month(int val)
Converts the numerical value for the month to
an actual string value, based upon the statically
loaded mappings. |
private static String |
width2(int val)
Converts the passed integer to a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
dateMap
private static Time.pair[] dateMap
- The month values to name mapping!
Time
public Time()
static void ()
- Load in the static date mappings
width2
private static String width2(int val)
- Converts the passed integer to a string. If the interger
value is less than 10, a zero is prefixed to the string.
- Parameters:
val
- The value to be converted- Returns:
- The converted number to string.
month
private static String month(int val)
- Converts the numerical value for the month to
an actual string value, based upon the statically
loaded mappings.
- Parameters:
val
- The value of the month- Returns:
- The converted month as a string.
format
public static String format(Calendar c)
- Format the time value in the DD-MMM-YYYY HH:MM:SS format.
- Parameters:
c
- The calendar representing the time.- Returns:
- The database formatted string.