|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.chart.JCChartDateFormat
JCChartDateFormat is a collection of methods and variables associated with time and date that are used throughout JCChart This class provides capabilities for writing internationalized code.
Constructor Summary | |
JCChartDateFormat()
|
Method Summary | |
protected void |
addToUnit(Date d,
long unit,
int value)
Adds a specified value to a particular unit in a Date instance. |
protected void |
calculateLargestTimeLabel(String pattern)
Calculates and returns the largest time label based on a pattern |
int |
getDateStyle()
Retrieve the current date style for the formatted time label. |
protected static String |
getDefaultTimeFormat(double range)
Internal method to return an appropriate time format for the provided range |
protected String |
getLargestLocaleTimeLabel()
Calculates and returns the largest time label based on the default locale |
protected String |
getLargestTimeLabel(String pattern)
|
protected static Date |
getMaxTime()
Returns the latest date that can be represented in Chart |
protected static Date |
getMinTime()
Returns the earliest date that can be represented in Chart |
int |
getTimeStyle()
Retrieve the current time style for the formatted time label. |
static void |
main(String[] args)
For testing purposes only |
protected long |
niceInc(long incr,
String pattern)
Return the value in seconds of the smallest "nice" time increment greater than 'incr'. |
protected void |
roundTime(Date d,
long unit,
boolean adjust)
Round the given time down/up to the given unit. |
void |
setDateStyle(int dateStyle)
Set the date style for formatted time label |
protected void |
setLocale(Locale locale)
Set the locale for formatting. |
void |
setTimeStyle(int timeStyle)
Set the time style for formatted time label |
protected void |
setTimeZone(TimeZone timeZone)
Set the time zone for formatting. |
protected static long |
timeIncUnits(long inc)
|
protected String |
timeLabel(Date date)
Given an instance of Date, returns a formatted time label using the default locale, current dateStyle, and current timeStyle. |
protected static String |
timeLabel(int style,
Date date,
Locale l)
Given a format style and an instance of Date, returns a formatted time label using the default locale. |
protected String |
timeLabel(String pattern,
Date date)
Given a format pattern and an instance of Date, returns a formatted time label using the default locale Time Format Syntax: To specify the time format use a time pattern string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JCChartDateFormat()
Method Detail |
protected void setLocale(Locale locale)
locale
- The new localeJCAxis.setLocale(java.util.Locale)
protected void setTimeZone(TimeZone timeZone)
timeZone
- The new time zoneJCAxis.setTimeZone(java.util.TimeZone)
public void setDateStyle(int dateStyle)
dateStyle
- The new date stylepublic int getDateStyle()
public void setTimeStyle(int timeStyle)
timeStyle
- The new time stylepublic int getTimeStyle()
protected String timeLabel(Date date)
date
- the Date to be localizedprotected static String timeLabel(int style, Date date, Locale l)
style
- the format style to be used in date/time localization and
can have one of the following valuesdate
- the Date to be localizedprotected String timeLabel(String pattern, Date date)
Symbol | Meaning | Presentation | Example |
---|---|---|---|
G | era designator | (Text) | AD | y | year | (Number) | 1997 | M | month in year | (Text & Number) | July & 07 | d | day in month | (Number) | 10 | h | hour in am/pm (1~12) | (Number) | 12 | H | hour in day (0~23) | (Number) | 0 | m | minute in hour | (Number) | 30 | s | second in minute | (Number) | 55 | S | millisecond | (Number) | 978 | E | day in week | (Text) | Tuesday | D | day in year | (Number) | 189 | F | day of week in month | (Number) | 2 (2nd Wed in July) | w | week in year | (Number) | 27 | W | week in month | (Number) | 2 | a | am/pm marker | (Text) | PM | k | hour in day (1~24) | (Number) | 24 | K | hour in am/pm (0~11) | (Number) | 0 | z | time zone | (Text) | Pacific Standard Time | ' | escape for text | (delimiter) | '' | single quote | (Literal) |
protected static Date getMinTime()
protected static Date getMaxTime()
protected String getLargestTimeLabel(String pattern)
protected void calculateLargestTimeLabel(String pattern)
pattern
- Time label formatprotected String getLargestLocaleTimeLabel()
protected void roundTime(Date d, long unit, boolean adjust)
d
- The date to be rounded.unit
- The unit of time (seconds, minutes, hours, days, etc)adjust
- If equal to 0, round down. If equal to 1, round up.protected long niceInc(long incr, String pattern)
protected static long timeIncUnits(long inc)
protected void addToUnit(Date d, long unit, int value)
d
- Date instance to be modifiedunit
- Time unit to which to addvalue
- Value to add to the specified unitprotected static String getDefaultTimeFormat(double range)
public static void main(String[] args)
args
- Command line arguments
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |