Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 2 (11.1.2.2.0)

E17492-03


oracle.adf.view.faces.bi.component.gantt
Class TimeAxisDateFormat

java.lang.Object
  extended by oracle.adf.view.faces.bi.component.gantt.TimeAxisDateFormat

All Implemented Interfaces:
java.io.Serializable

public class TimeAxisDateFormat
extends java.lang.Object
implements java.io.Serializable

The date formatter for TimeAxis control. The behavior of this class may be customized by providing arrays of formatting patterns for time axis. When a date is formatted, its index is used to find a corresponding format pattern from the array (see format() method description for information about the date index). If the array is too small, the first pattern is used. Then the pattern is evaluated by Javas SimpleDateFormat class (see SimpleDateFormat documentation for more information). Within a pattern string, characters from A to Z and from a to z are reserved for pattern definition. They will be interpreted by SimpleDateFormat. Text can be quoted using single quotes (?) to avoid interpretation.

See Also:
Serialized Form

Field Summary
static int LONG
          Constants for long style pattern.
static int SHORT
          Constants for short style pattern.

 

Constructor Summary
TimeAxisDateFormat(java.util.Locale locale, java.util.TimeZone timezone, boolean isThaiGregorian)
          Constructs an instance of TimeAxisDateFormat.

 

Method Summary
 java.lang.String format(java.util.Date date, int index, java.lang.String scale)
          Formats the specified date based on the time scale and index relative to the time scale.
 java.lang.String[] getScaleFormatPatterns(java.lang.String scale)
          Gets custom format patterns for the major scale
 java.util.TimeZone getTimeZone()
          Gets the time zone used when a date is formatted
 void setDefaultStylePattern(int style)
          Specifies the default style pattern to use when date is formatted.
 void setScaleFormatPatterns(java.lang.String scale, java.lang.String[] patterns)
          Sets custom format patterns for the major scale
 void setTimeZone(java.util.TimeZone timeZone)
          Sets the time zone to use when a date is formatted

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

LONG

public static final int LONG
Constants for long style pattern.
See Also:
Constant Field Values

SHORT

public static final int SHORT
Constants for short style pattern.
See Also:
Constant Field Values

Constructor Detail

TimeAxisDateFormat

public TimeAxisDateFormat(java.util.Locale locale,
                          java.util.TimeZone timezone,
                          boolean isThaiGregorian)
Constructs an instance of TimeAxisDateFormat.
Parameters:
locale - the locale for the formatter.
timezone - the timezone for the formatter.
isThaiGregorian - true if the Thai Gregorian calendar is used. false if otherwise.

Method Detail

setDefaultStylePattern

public void setDefaultStylePattern(int style)
Specifies the default style pattern to use when date is formatted.
Parameters:
style - the style pattern to use when date is formatted
See Also:
oracle.adf.view.faces.bi.component.gantt.TimeAxisDateFormat.LONG, oracle.adf.view.faces.bi.component.gantt.TimeAxisDateFormat.SHORT

format

public java.lang.String format(java.util.Date date,
                               int index,
                               java.lang.String scale)
                        throws InvalidScaleException
Formats the specified date based on the time scale and index relative to the time scale.
Parameters:
date - the date to format.
index - the index relative to the time scale.
scale - the time scale in which the date is formatted.
Returns:
the formatted date.
Throws:
InvalidScaleException

setScaleFormatPatterns

public void setScaleFormatPatterns(java.lang.String scale,
                                   java.lang.String[] patterns)
                            throws InvalidScaleException
Sets custom format patterns for the major scale
Parameters:
scale - the time scale for which the format patterns are set
patterns - the custom format patterns to set
Throws:
InvalidScaleException

getScaleFormatPatterns

public java.lang.String[] getScaleFormatPatterns(java.lang.String scale)
                                          throws InvalidScaleException
Gets custom format patterns for the major scale
Parameters:
scale - the time scale for which the format patterns are set
Returns:
the custom format patterns
Throws:
InvalidScaleException

setTimeZone

public void setTimeZone(java.util.TimeZone timeZone)
Sets the time zone to use when a date is formatted
Parameters:
timeZone - the time zone to use when a date is formatted

getTimeZone

public java.util.TimeZone getTimeZone()
Gets the time zone used when a date is formatted
Returns:
the time zone used when a date is formatted

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 2 (11.1.2.2.0)

E17492-03


Copyright © 1997, 2012, Oracle. All rights reserved.