Package com.mckoi.util
Class GeneralFormatter
- java.lang.Object
-
- com.mckoi.util.GeneralFormatter
-
public class GeneralFormatter extends java.lang.ObjectThis class provides several static convenience functions for formatting various types of information such as a time frame.
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_DAYSstatic intMAX_HOURSstatic intMAX_MILLISECONDSstatic intMAX_MINUTESstatic intMAX_SECONDSstatic intMAX_WEEKSThese statics represent switches for the visual formatting of the time frame.private static longMILLIS_IN_DAYprivate static longMILLIS_IN_HOURprivate static longMILLIS_IN_MINUTEprivate static longMILLIS_IN_SECONDprivate static longMILLIS_IN_WEEKThese statics represent some information about how many milliseconds are in various measures of time.
-
Constructor Summary
Constructors Constructor Description GeneralFormatter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidappendDayType(java.lang.StringBuffer str, double total, boolean shorthand)private static voidappendFrame(java.lang.StringBuffer str, double num, java.lang.String frame, boolean do_round, boolean append_plural_s)Appends a frame of time onto the given StringBuffer.static voidappendHourType(java.lang.StringBuffer str, double total, boolean shorthand)static voidappendMinuteType(java.lang.StringBuffer str, double total, boolean shorthand)static voidappendWeekType(java.lang.StringBuffer str, double total, boolean shorthand)Appends time frame representation information into the given StringBuffer for various types of visual time frame formats.
-
-
-
Field Detail
-
MAX_WEEKS
public static final int MAX_WEEKS
These statics represent switches for the visual formatting of the time frame. It is desirable to have the time frame represented in different denominations.- See Also:
- Constant Field Values
-
MAX_DAYS
public static final int MAX_DAYS
- See Also:
- Constant Field Values
-
MAX_HOURS
public static final int MAX_HOURS
- See Also:
- Constant Field Values
-
MAX_MINUTES
public static final int MAX_MINUTES
- See Also:
- Constant Field Values
-
MAX_SECONDS
public static final int MAX_SECONDS
- See Also:
- Constant Field Values
-
MAX_MILLISECONDS
public static final int MAX_MILLISECONDS
- See Also:
- Constant Field Values
-
MILLIS_IN_WEEK
private static final long MILLIS_IN_WEEK
These statics represent some information about how many milliseconds are in various measures of time.- See Also:
- Constant Field Values
-
MILLIS_IN_DAY
private static final long MILLIS_IN_DAY
- See Also:
- Constant Field Values
-
MILLIS_IN_HOUR
private static final long MILLIS_IN_HOUR
- See Also:
- Constant Field Values
-
MILLIS_IN_MINUTE
private static final long MILLIS_IN_MINUTE
- See Also:
- Constant Field Values
-
MILLIS_IN_SECOND
private static final long MILLIS_IN_SECOND
- See Also:
- Constant Field Values
-
-
Method Detail
-
appendFrame
private static void appendFrame(java.lang.StringBuffer str, double num, java.lang.String frame, boolean do_round, boolean append_plural_s)Appends a frame of time onto the given StringBuffer. This is used to construct a string representing the current time frame.
-
appendWeekType
public static void appendWeekType(java.lang.StringBuffer str, double total, boolean shorthand)Appends time frame representation information into the given StringBuffer for various types of visual time frame formats.
-
appendDayType
public static void appendDayType(java.lang.StringBuffer str, double total, boolean shorthand)
-
appendHourType
public static void appendHourType(java.lang.StringBuffer str, double total, boolean shorthand)
-
appendMinuteType
public static void appendMinuteType(java.lang.StringBuffer str, double total, boolean shorthand)
-
-