|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart3djava.ChartObj
com.quinncurtis.chart3djava.ChartCalendar
public class ChartCalendar
This class provides utilities for manipulating GregorianCalendar objects.
Field Summary | |
---|---|
static java.util.GregorianCalendar |
epochDate
The number of milliseconds per day |
static long |
epochOffset
The epoch offset. |
static int |
milliSecondsPerDay
The number of milliseconds per day |
static int |
ticksPerMilliSecond
The number of ticks (100 nanosecond intervals) per millisecond |
static int |
ticksPerSecond
The number of ticks (100 nanosecond intervals) per second |
Constructor Summary | |
---|---|
ChartCalendar()
The default DBufferedImage constructor. |
Method Summary | |
---|---|
static void |
calendarCeil(java.util.GregorianCalendar arg1,
int nresolution)
This method zeros out the specified fields of a GregorianCalendar date and rounds up to the specified field value. |
static boolean |
calendarCompare(java.util.GregorianCalendar arg1,
java.util.GregorianCalendar arg2)
This method compares and returns true if one ChartCalendar date is less than or equal to another. |
static boolean |
calendarCompare2(java.util.GregorianCalendar arg1,
java.util.GregorianCalendar arg2)
This method compares and returns true if one GregorianCalendar date is less than or equal to another. |
static boolean |
calendarCompare22(java.util.GregorianCalendar arg1,
java.util.GregorianCalendar arg2)
This method compares and returns true if one GregorianCalendar date is less than or equal to another. |
static void |
calendarCopy(java.util.GregorianCalendar dest,
java.util.GregorianCalendar source)
This method copies the one date into another. |
static java.util.GregorianCalendar |
calendarDaysAdd(java.util.GregorianCalendar dstart,
long numdays,
int nweektype)
This method adds a fixed number of days to a date, taking into account whether or not a WEEK_5D or WEEK_7D mode is in affect. |
static long |
calendarDaysDiff(java.util.GregorianCalendar dstart,
java.util.GregorianCalendar dstop,
int nweektype)
Calculates the number of days between two dates, taking into account whether or not a WEEK_5D or WEEK_7D mode is in affect. |
static java.util.GregorianCalendar |
calendarMax(java.util.GregorianCalendar d1,
java.util.GregorianCalendar d2)
This method compares two GregorianCalendar dates and returns the later date of the two. |
static java.util.GregorianCalendar |
calendarMin(java.util.GregorianCalendar d1,
java.util.GregorianCalendar d2)
This method compares two GregorianCalendar dates and returns the earlier date of the two. |
static void |
calendarSwap(java.util.GregorianCalendar d1,
java.util.GregorianCalendar d2)
This swaps one date with another. |
static void |
calendarTruncate(java.util.GregorianCalendar arg1,
int nresolution)
This method zeros out the specified fields of a GregorianCalendar date. |
static void |
calendarWeekAdjust(java.util.GregorianCalendar result,
int nweektype,
boolean forward)
This method adjusts the value a GregorianCalendar day, increasing or decreasing the date to a valid day-of-the=week if the WEEK_5D week type is specified. |
static boolean |
checkValidDate(java.util.GregorianCalendar ddate,
int nweektype)
This check to see if the given date is a valid date for the given week type (WEEK_5D or WEEK_7D). |
static boolean |
checkValidDate(java.util.GregorianCalendar ddate,
long starttime,
long stoptime,
int nweektype)
This check to see if the given date is a valid date for the given week type (WEEK_5D or WEEK_7D), and the non-24 day hour range. |
static long |
getCalendarMsecs(java.util.GregorianCalendar date)
Returns the number of milliseconds corresponding to a GregorianCalendar date. |
static long |
getCalendarSecs(java.util.GregorianCalendar date)
Returns the number of seconds corresponding to a GregorianCalendar date. |
static double |
getCalendarWidthValue(int timebase,
double width)
Many of the plotting routines require a "width" property, the value of which may not be intuitive give the wide range of scales supported by the time and date coordinate systems. |
static java.awt.Dimension |
getTimeAxisTickParameters(int timebase,
int weekmode)
Calculates the axis properties minorTicksPerMajor, and minorNthTick, based on the axisTickMarkTimeBase property of a time axis. |
static long |
getTODMsecs(java.util.GregorianCalendar date)
Returns the number of milliseconds corresponding to the time-of-day part of a GregorianCalendar date. |
static long |
getTODSeconds(java.util.GregorianCalendar date)
Returns the number of seconds corresponding to the time-of-day part of a GregorianCalendar date. |
static java.util.GregorianCalendar |
newCalendar(java.util.GregorianCalendar source)
This method allocates a new GregorianCalendar date and copies the source date into it. |
static java.util.GregorianCalendar |
newCalendar(long msecs)
This method allocates a new GregorianCalendar date and copies the source date into it. |
static void |
setCalendarMsecs(java.util.GregorianCalendar date,
long msecs)
A milliseconds value is converted into the equivalent GregorianCalendar date. |
static void |
setCalendarSecs(java.util.GregorianCalendar date,
long secs)
A seconds value is converted into the equivalent GregorianCalendar date. |
static void |
setTOD(java.util.GregorianCalendar ddate,
java.util.GregorianCalendar ttime)
Sets the time of day fields (hours, minutes, seconds) of the first argument to match the time of day fields of the second argument. |
static void |
setTOD(java.util.GregorianCalendar ddate,
int hour,
int minute,
int second)
Sets the time of day fields in a GregorianCalendar date. |
static void |
setTODMsecs(java.util.GregorianCalendar ddate,
long milliseconds)
Sets the time of day fields in a GregorianCalendar date. |
static void |
setTODSeconds(java.util.GregorianCalendar ddate,
long seconds)
Sets the time of day fields in a GregorianCalendar date. |
static java.lang.String |
toString(java.util.GregorianCalendar tdate)
Converts a Gregorian calendar date value into a formatted date string. |
static java.lang.String |
toString(java.util.GregorianCalendar tdate,
int ndateformat)
Converts a Gregorian calendar date value into a formatted date string. |
Methods inherited from class com.quinncurtis.chart3djava.ChartObj |
---|
copy, errorCheck, getChartObjIDCntr, getChartObjType, getThisChartObjID |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ticksPerSecond
public static final int ticksPerMilliSecond
public static final int milliSecondsPerDay
public static final java.util.GregorianCalendar epochDate
public static final long epochOffset
Constructor Detail |
---|
public ChartCalendar()
Method Detail |
---|
public static long getCalendarMsecs(java.util.GregorianCalendar date)
date
- The GregorianCalendar date that Gets converted to milliseconds.
public static long getCalendarSecs(java.util.GregorianCalendar date)
date
- The GregorianCalendar date that gets converted to seconds.
public static long getTODMsecs(java.util.GregorianCalendar date)
date
- The GregorianCalendar date that is converted to the time-of-day result.
public static long getTODSeconds(java.util.GregorianCalendar date)
date
- The GregorianCalendar date that is converted to the time-of-day result.
public static void setCalendarMsecs(java.util.GregorianCalendar date, long msecs)
date
- The milliseconds value is used to set the GregorianCalendar date of this parameter.msecs
- This value is converted into a GregorianCalendar date and it is returned
as the date parameter.public static void setCalendarSecs(java.util.GregorianCalendar date, long secs)
date
- The seconds value is used to set the GregorianCalendar date of this parameter.secs
- This value is converted into a GregorianCalendar date and it is returned
as the date parameter.public static void calendarWeekAdjust(java.util.GregorianCalendar result, int nweektype, boolean forward)
result
- The GregorianCalendar date that is adjusted.nweektype
- The calendar week type (WEEK_5D or WEEK_7D).forward
- If true, the date is incremented forward if it is on a date invalid
for the current week type. If false, the date is incremented back if it is on a date invalid
for the current week type.public static boolean calendarCompare2(java.util.GregorianCalendar arg1, java.util.GregorianCalendar arg2)
arg1
- The first GregorianCalendar argument.arg2
- The second GregorianCalendar argument.
public static boolean calendarCompare22(java.util.GregorianCalendar arg1, java.util.GregorianCalendar arg2)
arg1
- The first GregorianCalendar argument.arg2
- The second GregorianCalendar argument.
public static void setTOD(java.util.GregorianCalendar ddate, java.util.GregorianCalendar ttime)
ddate
- The GregorianCalendar date argument that is modified.ttime
- The GregorianCalendar date argument that has the source
time of day fields.public static void setTOD(java.util.GregorianCalendar ddate, int hour, int minute, int second)
ddate
- The time of day fields of this date are set to value of the
hour, minute and seconds parameters.hour
- The hour (0-23) of the time of day.minute
- The minute (0-59) of the time of day.second
- The second (0-59) of the time of day.public static void setTODSeconds(java.util.GregorianCalendar ddate, long seconds)
ddate
- The time of day fields of this date are set to value of the
seconds parameter.seconds
- The number of seconds since midnight for the current TOD.public static void setTODMsecs(java.util.GregorianCalendar ddate, long milliseconds)
ddate
- The time of day fields of this date are set to value of the
milliseconds parameter.milliseconds
- The number of seconds since midnight for the current TOD.public static void calendarTruncate(java.util.GregorianCalendar arg1, int nresolution)
arg1
- The date that is modified.nresolution
- All calendar field values equal to or less than this
field value are set to 0. Use one of the Calendar class field constants,
for example: Calendar.YEAR, Calendar.MONTH, Calendar.WEEK_OF_MONTH, etc.).public static void calendarCeil(java.util.GregorianCalendar arg1, int nresolution)
arg1
- The date that is modified.nresolution
- All calendar field values equal to or less than this
field value are set to 0. Use one of the Calendar class field constants,
for example: Calendar.YEAR, Calendar.MONTH, Calendar.WEEK_OF_MONTH, etc.).public static java.util.GregorianCalendar calendarMin(java.util.GregorianCalendar d1, java.util.GregorianCalendar d2)
d1
- The first GregorianCalendar argument.d2
- The second GregorianCalendar argument.
public static java.util.GregorianCalendar calendarMax(java.util.GregorianCalendar d1, java.util.GregorianCalendar d2)
d1
- The first GregorianCalendar argument.d2
- The second GregorianCalendar argument.
public static long calendarDaysDiff(java.util.GregorianCalendar dstart, java.util.GregorianCalendar dstop, int nweektype)
dstart
- The first GregorianCalendar argument. The
date dstart should be earlier in time than dstop.dstop
- The second GregorianCalendar argument.nweektype
- The calendar week type (WEEK_5D or WEEK_7D).
public static java.util.GregorianCalendar calendarDaysAdd(java.util.GregorianCalendar dstart, long numdays, int nweektype)
dstart
- The starting GregorianCalendar argument.numdays
- The number of days to add to the date dstart.nweektype
- The calendar week type (WEEK_5D or WEEK_7D).
public static boolean checkValidDate(java.util.GregorianCalendar ddate, int nweektype)
ddate
- The GregorianCalendar argument.nweektype
- The calendar week type (WEEK_5D or WEEK_7D).
public static boolean checkValidDate(java.util.GregorianCalendar ddate, long starttime, long stoptime, int nweektype)
ddate
- The GregorianCalendar argument.starttime
- The starttime of the day, in milliseconds.stoptime
- The stoptime of the day, in millisecondsnweektype
- The calendar week type (WEEK_5D or WEEK_7D).
public static void calendarCopy(java.util.GregorianCalendar dest, java.util.GregorianCalendar source)
dest
- The destination GregorianCalendar argument.source
- The source GregorianCalendar argument.public static java.util.GregorianCalendar newCalendar(java.util.GregorianCalendar source)
source
- The source GregorianCalendar argument.
public static java.util.GregorianCalendar newCalendar(long msecs)
msecs
- The source GregorianCalendar argument.
public static void calendarSwap(java.util.GregorianCalendar d1, java.util.GregorianCalendar d2)
d1
- GregorianCalendar argument.d2
- GregorianCalendar argument.public static double getCalendarWidthValue(int timebase, double width)
timebase
- The GregorianCalendar field, such as Calendar.HOUR,
that represents the units of the width parameter.width
- The width to be converted to milliseconds, based on the
time super.
public static java.awt.Dimension getTimeAxisTickParameters(int timebase, int weekmode)
timebase
- The axisTickMarkTimeBase property of an axis, TIMEAXIS_MONTHDAY,
for example.weekmode
- The calendar week type (WEEK_5D or WEEK_7D).
public static boolean calendarCompare(java.util.GregorianCalendar arg1, java.util.GregorianCalendar arg2)
arg1
- The first ChartCalendar argument.arg2
- The second ChartCalendar argument.
public static java.lang.String toString(java.util.GregorianCalendar tdate, int ndateformat)
tdate
- The date value that is to be converted into a formatted date string.ndateformat
- Specifies a predefined date format. Use one of the Time/Date axis time
label constants.
public static java.lang.String toString(java.util.GregorianCalendar tdate)
tdate
- The date value that is to be converted into a formatted date string.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |