Novell exteNd
Director 5.2 API

com.sssw.fw.util
Class EboFormat

java.lang.Object
 |
 +--com.sssw.fw.util.EboFormat

public final class EboFormat
extends Object

The EboFormat class provides static helper methods to format long, double, date, time and datetime objects. Please see the JDK documentation of NumberFormat, DateFormat, DecimalFormat, SimpleDateFormat for more details.

Note that expontial notation is not currently supported for BigDecimals.


Field Summary
static int CURRENCYSTYLE
          The currency style for the style parameters of the format methods.
static int DEFAULT
          The default style for the style parameter of the format methods.
static int FULL
          The full style for the style parameter of the format methods.
static int LONG
          The long style for the style parameter of the format methods.
static int NUMBERSTYLE
          The number style for the style parameters of the format methods.
static int PERCENTSTYLE
          The percent style for the style parameter of the format methods.
static int SHORT
          The short style for the style parameter of the format methods.
static int SHORT4
          The short4 style for the style parameter of the format methods.
 
Constructor Summary
EboFormat()
           
 
Method Summary
static String format(Object ob, String pattern)
          Format an object and produce formatted output string.
static String format(Object ob, String pattern, int style)
          Format an object and produce formatted output string.
static String format(Object ob, String pattern, int timeStyle, int dateStyle)
          Format an object and produce formatted output string.
static String format(Object ob, String pattern, int style1, int style2, Locale locale, String zoneStr)
          Format an object and produce formatted output string.
static String format(Object ob, String pattern, int style1, int style2, String lang, String country, String variant, String zoneStr)
          Format an object and produce formatted output string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMBERSTYLE

public static final int NUMBERSTYLE
The number style for the style parameters of the format methods.

CURRENCYSTYLE

public static final int CURRENCYSTYLE
The currency style for the style parameters of the format methods.

PERCENTSTYLE

public static final int PERCENTSTYLE
The percent style for the style parameter of the format methods.

DEFAULT

public static final int DEFAULT
The default style for the style parameter of the format methods.

SHORT

public static final int SHORT
The short style for the style parameter of the format methods.

SHORT4

public static final int SHORT4
The short4 style for the style parameter of the format methods.

LONG

public static final int LONG
The long style for the style parameter of the format methods.

FULL

public static final int FULL
The full style for the style parameter of the format methods.
Constructor Detail

EboFormat

public EboFormat()
Method Detail

format

public static String format(Object ob,
                            String pattern)
Format an object and produce formatted output string.
Parameters:
ob - - object, can be Long, Double, java.sql.Date, java.util.Date, Time or Timestamp, java.util.Calendar, java.math.BigDecimal
pattern - - string, overrides default pattern
Returns:
string or null example - EboFormat.format(date_col, "yyyy/MM/dd");

format

public static String format(Object ob,
                            String pattern,
                            int style)
Format an object and produce formatted output string.
Parameters:
ob - - object, can be Long, Double, java.sql.Date, java.util.Date, Time or Timestamp, java.util.Calendar, java.math.BigDecimal
pattern - - string, overrides default pattern
style - - overrides default style
Returns:
string or null

format

public static String format(Object ob,
                            String pattern,
                            int timeStyle,
                            int dateStyle)
Format an object and produce formatted output string.
Parameters:
ob - - object, Timestamp only
pattern - - string, overrides default pattern
timeStyle - - int, overrides default style for time
dateStyle - - int, overrides default style for date
Returns:
string or null

format

public static String format(Object ob,
                            String pattern,
                            int style1,
                            int style2,
                            String lang,
                            String country,
                            String variant,
                            String zoneStr)
Format an object and produce formatted output string.
Parameters:
ob - - object, can be Date or Time
pattern - - string, overrides default pattern
style1 - - int, overrides default style
style2 - - int, overrides default style (used for Timestamp)
lang - - string, overrides default language (part of Locale)
country - - string, overrides default country (part of locale)
variant - - string, overrides default variant (part of locale)
zoneStr - - timezone, overrides default timezone (empty string or null for Date)
Returns:
string or null

format

public static String format(Object ob,
                            String pattern,
                            int style1,
                            int style2,
                            Locale locale,
                            String zoneStr)
Format an object and produce formatted output string.
Parameters:
ob - - object, can be Date or Time
pattern - - string, overrides default pattern
style1 - - int, overrides default style
style2 - - int, overrides default style (used for Timestamp)
locale - - java.util.locale, overrides default locale
zoneStr - - timezone, overrides default timezone (empty string or null for Date)
Returns:
string or null

Novell exteNd
Director 5.2 API