com.starteam.util
Class DateTimeFormat

java.lang.Object
  extended by com.starteam.util.DateTimeFormat

public abstract class DateTimeFormat
extends java.lang.Object

Formats dates in a locale-sensitive manner.


Field Summary
static int LONG
          Constant used to specify long format for both dates and times.
static int SHORT
          Constant used to specify short format for both dates and times.
 
Method Summary
abstract  java.lang.String format(DateTime date)
          Returns a string formatted according to the style(s) passed to the appropriate method that was used to create the DateTimeFormat.
static DateTimeFormat getDateInstance(int style)
          Returns a platform-dependent version of DateTimeFormat that can be used to create a date string formatted in the given style.
static DateTimeFormat getDateTimeInstance(int dateStyle, int timeStyle)
          Returns a platform-dependent version of DateTimeFormat that can be used to create a date-time string formatted in the given styles.
static DateTimeFormat getLocalDateInstance()
          Returns a platform-dependent version of DateTimeFormat that can be used to create a date string formatted in the style typically found in item display tables.
static DateTimeFormat getLocalDateTimeInstance()
          Returns a platform-dependent version of DateTimeFormat that can be used to create a date/time string formatted in the style typically found in item display tables.
static DateTimeFormat getTimeInstance(int style)
          Returns a platform-dependent version of DateTimeFormat that can be used to create a time string formatted in the given style.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHORT

public static final int SHORT
Constant used to specify short format for both dates and times.

See Also:
Constant Field Values

LONG

public static final int LONG
Constant used to specify long format for both dates and times.

See Also:
Constant Field Values
Method Detail

getLocalDateTimeInstance

public static DateTimeFormat getLocalDateTimeInstance()
Returns a platform-dependent version of DateTimeFormat that can be used to create a date/time string formatted in the style typically found in item display tables.

Returns:
a platform-dependent version of DateTimeFormat that can be used to create a date/time string formatted in the style typically found in item display tables.

getLocalDateInstance

public static DateTimeFormat getLocalDateInstance()
Returns a platform-dependent version of DateTimeFormat that can be used to create a date string formatted in the style typically found in item display tables.

Returns:
a platform-dependent version of DateTimeFormat that can be used to create a date string formatted in the style typically found in item display tables.

getTimeInstance

public static DateTimeFormat getTimeInstance(int style)
Returns a platform-dependent version of DateTimeFormat that can be used to create a time string formatted in the given style.

Parameters:
style - Either DateTimeFormat.SHORT or DateTimeFormat.LONG, determines the format of the resulting time string.
Returns:
a platform-dependent version of DateTimeFormat that can be used to create a time string formatted in the given style.

getDateInstance

public static DateTimeFormat getDateInstance(int style)
Returns a platform-dependent version of DateTimeFormat that can be used to create a date string formatted in the given style.

Parameters:
style - Either DateTimeFormat.SHORT or DateTimeFormat.LONG, determines the format of the resulting date string.
Returns:
a platform-dependent version of DateTimeFormat that can be used to create a date string formatted in the given style.

getDateTimeInstance

public static DateTimeFormat getDateTimeInstance(int dateStyle,
                                                 int timeStyle)
Returns a platform-dependent version of DateTimeFormat that can be used to create a date-time string formatted in the given styles.

Parameters:
dateStyle - Either DateTimeFormat.SHORT or DateTimeFormat.LONG, determines the format of the date portion of the resulting string.
timeStyle - Either DateTimeFormat.SHORT or DateTimeFormat.LONG, determines the format of the time portion of the resulting string.
Returns:
a platform-dependent version of DateTimeFormat that can be used to create a date-time string formatted in the given styles.

format

public abstract java.lang.String format(DateTime date)
Returns a string formatted according to the style(s) passed to the appropriate method that was used to create the DateTimeFormat.

Parameters:
date - The date whose value is formatted.
Returns:
a string formatted according to the style(s) passed to the appropriate method that was used to create the DateTimeFormat.


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.