public abstract class IlvTimeUnit extends Object implements Serializable
The IlvTimeUnit
class supports alternate locales by utilizing
resource files to store format string associated with predefined time units.
IlvTimeStepsDefinition.setUnit(ilog.views.chart.IlvTimeUnit)
,
IlvCalendarUtil
,
Serialized FormModifier and Type | Field and Description |
---|---|
static IlvTimeUnit |
CENTURY
Predefined unit for centuries.
|
static IlvTimeUnit |
DAY
Predefined unit for days.
|
static IlvTimeUnit |
DECADE
Predefined unit for decades.
|
static IlvTimeUnit |
HOUR
Predefined unit for hours.
|
static IlvTimeUnit |
MILLISECOND
Predefined unit for milliseconds.
|
static IlvTimeUnit |
MINUTE
Predefined unit for minutes.
|
static IlvTimeUnit |
MONTH
Predefined unit for months.
|
static IlvTimeUnit |
QUARTER
Predefined unit for quarters.
|
static IlvTimeUnit |
SECOND
Predefined unit for seconds.
|
static IlvTimeUnit |
WEEK
Predefined unit for weeks.
|
static IlvTimeUnit |
YEAR
Predefined unit for years.
|
Modifier | Constructor and Description |
---|---|
protected |
IlvTimeUnit()
Initializes a new time unit.
|
Modifier and Type | Method and Description |
---|---|
String |
format(DateFormat fmt,
Calendar cal)
Deprecated.
Starting with JViews 8.8, please use and implement the method
format(DateFormat, Calendar, Locale) instead. |
String |
format(DateFormat fmt,
Calendar cal,
Locale locale)
Returns the label corresponding to the specified time.
|
abstract String |
getFormatString()
Deprecated.
Starting with JViews 8.8, please use and implement the method
getFormatString(Locale) instead. |
String |
getFormatString(Locale locale)
Returns a string pattern used by the
IlvTimeStepsDefinition class. |
abstract double |
getMillis()
Returns the number of milliseconds corresponding to this unit.
|
abstract Calendar |
incrementTime(Calendar cal)
Increments the specified time according to this unit.
|
abstract Calendar |
previousUnitTime(Calendar cal)
Truncates the given
Calendar downwards to the nearest multiple
of this unit. |
public static final IlvTimeUnit MILLISECOND
public static final IlvTimeUnit SECOND
public static final IlvTimeUnit MINUTE
public static final IlvTimeUnit HOUR
public static final IlvTimeUnit DAY
public static final IlvTimeUnit WEEK
public static final IlvTimeUnit MONTH
public static final IlvTimeUnit QUARTER
public static final IlvTimeUnit YEAR
public static final IlvTimeUnit DECADE
public static final IlvTimeUnit CENTURY
public abstract Calendar previousUnitTime(Calendar cal)
Calendar
downwards to the nearest multiple
of this unit. The method modifies the cal
parameter and
returns it.cal
- The considered time.public abstract Calendar incrementTime(Calendar cal)
cal
parameter and returns it.cal
- The considered time.public abstract double getMillis()
@Deprecated public abstract String getFormatString()
getFormatString(Locale)
instead.IlvTimeStepsDefinition
class.
It should be a pattern that obeys the syntax for a SimpleDateFormat
or com.ibm.icu.text.SimpleDateFormat
.public String getFormatString(Locale locale)
IlvTimeStepsDefinition
class.
It should be a pattern that obeys the syntax for a SimpleDateFormat
or com.ibm.icu.text.SimpleDateFormat
.locale
- The locale of the chart.@Deprecated public String format(DateFormat fmt, Calendar cal)
format(DateFormat, Calendar, Locale)
instead.fmt
- The default date format used by the IlvTimeStepsDefinition
class. This format is created according to the string pattern
returned by getFormatString()
.cal
- The considered time.public String format(DateFormat fmt, Calendar cal, Locale locale)
fmt
- The default date format used by the IlvTimeStepsDefinition
class. This format is created according to the string pattern
returned by getFormatString()
.cal
- The considered time.locale
- The locale of the chart.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.