Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.4.0)

E12063-05

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 Java?s 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
 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
 
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:
axis - which axis.
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 -
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 - format patterns are set for this scale
patterns - custom format patterns
Throws:
InvalidScaleException

getScaleFormatPatterns

public java.lang.String[] getScaleFormatPatterns(java.lang.String scale)
                                          throws InvalidScaleException
Gets custom format patterns for the major scale

Parameters:
scale - format patterns are set for this scale
Returns:
custom format patterns
Throws:
InvalidScaleException

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.4.0)

E12063-05

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