com.starbase.util
Class OLEDateFormat

java.lang.Object
  |
  +--com.starbase.util.OLEDateFormat

public abstract class OLEDateFormat
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
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
abstract  java.lang.String format(OLEDate date)
          Returns a string formatted according to the style(s) passed to the getXxx() method that was used to create the OLEDateFormat.
static OLEDateFormat getDateInstance(int style)
          Returns a platform-dependent version of OLEDateFormat that can be used to create a date string formatted in the given style.
static OLEDateFormat getDateTimeInstance(int dateStyle, int timeStyle)
          Returns a platform-dependent version of OLEDateFormat that can be used to create a date-time string formatted in the given styles.
static OLEDateFormat getLocalDateInstance()
          Returns a platform-dependent version of OLEDateFormat that can be used to create a date string formatted in the style typically found in item display tables.
static OLEDateFormat getLocalDateTimeInstance()
          Returns a platform-dependent version of OLEDateFormat that can be used to create a date/time string formatted in the style typically found in item display tables.
static OLEDateFormat getTimeInstance(int style)
          Returns a platform-dependent version of OLEDateFormat that can be used to create a time string formatted in the given style.
 int hashCode()
          returns a unique hash for all instances of this type
 
Methods inherited from class java.lang.Object
getClass, 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 OLEDateFormat getLocalDateTimeInstance()
Returns a platform-dependent version of OLEDateFormat 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 OLEDateFormat that can be used to create a date/time string formatted in the style typically found in item display tables.

getLocalDateInstance

public static OLEDateFormat getLocalDateInstance()
Returns a platform-dependent version of OLEDateFormat 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 OLEDateFormat that can be used to create a date string formatted in the style typically found in item display tables.

getTimeInstance

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

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

getDateInstance

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

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

getDateTimeInstance

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

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

format

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

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

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.