com.cc.framework.util
Class Formatter

java.lang.Object
  extended bycom.cc.framework.util.Formatter

public abstract class Formatter
extends java.lang.Object

This class provides functions for formatting Strings

Since:
1.0
Version:
$Revision: 1.18 $
Author:
Harald Schulz

Constructor Summary
private Formatter()
          Constructor
 
Method Summary
static java.lang.String formatBytes(long bytes)
          Formats Bytes in the format ..bytes, ..kb oder ..mb
static java.lang.String formatDate(java.util.Date date)
          This method returns a String representing a formatted date.
static java.lang.String formatDate(java.util.Date date, java.lang.String zone)
          This method returns a String representing a formatted date.
static java.lang.String formatDateAndTime(java.util.Date date)
          This method returns a String representing a formatted date.
static java.lang.String formatDateAndTime(long date)
          This method returns a String representing a formatted date.
static java.lang.String formatTime(java.sql.Time time)
          This method returns a String representing a formatted time.
static java.lang.String formatTimeSpan(long span)
          This method returns a String representing a formatted time span.
static java.util.Locale parseLocale(java.lang.String locale)
          Parses a String into a Locale Object.
static java.util.TimeZone parseTimeZone(java.lang.String zone)
          Parses a String into a TimeZone Object.
static java.lang.String splitHtmlString(java.lang.String str, int length)
          This method inserts a HTML break tag at the specified position into an String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Formatter

private Formatter()
Constructor

Method Detail

parseLocale

public static java.util.Locale parseLocale(java.lang.String locale)
Parses a String into a Locale Object.

Parameters:
locale - String to parse
Returns:
locale Object or null when the String is empty

parseTimeZone

public static java.util.TimeZone parseTimeZone(java.lang.String zone)
Parses a String into a TimeZone Object.

Parameters:
zone - String to parse
Returns:
TimeZone Object or null when the String is empty

formatBytes

public static java.lang.String formatBytes(long bytes)
Formats Bytes in the format ..bytes, ..kb oder ..mb

Parameters:
bytes - Number to format
Returns:
The formatted byte size

formatDate

public static java.lang.String formatDate(java.util.Date date)
This method returns a String representing a formatted date.

Parameters:
date - The date value to be formatted into a time string.
Returns:
the formatted date string

formatDate

public static java.lang.String formatDate(java.util.Date date,
                                          java.lang.String zone)
This method returns a String representing a formatted date.

Parameters:
date - The date value to be formatted into a date string.
zone - The timezone value to be used in the formatted date string
Returns:
the formatted date string

formatDateAndTime

public static java.lang.String formatDateAndTime(java.util.Date date)
This method returns a String representing a formatted date.

Parameters:
date - The date value to be formatted into a time string.
Returns:
the formatted date string

formatDateAndTime

public static java.lang.String formatDateAndTime(long date)
This method returns a String representing a formatted date.

Parameters:
date - The date value to be formatted into a time string.
Returns:
the formatted date string

formatTime

public static java.lang.String formatTime(java.sql.Time time)
This method returns a String representing a formatted time.

Parameters:
time - The time value to be formatted into a time string.
Returns:
the formatted time string

formatTimeSpan

public static java.lang.String formatTimeSpan(long span)
This method returns a String representing a formatted time span.

Parameters:
span - The time span
Returns:
the formatted time span string

splitHtmlString

public static java.lang.String splitHtmlString(java.lang.String str,
                                               int length)
This method inserts a HTML break tag at the specified position into an String.

Parameters:
str - String to process
length - Position where the break should be inserted
Returns:
String


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.