net.sourceforge.atunes.utils
Class StringUtils

java.lang.Object
  extended by net.sourceforge.atunes.utils.StringUtils

public class StringUtils
extends java.lang.Object

Utility methods for Strings.


Constructor Summary
StringUtils()
           
 
Method Summary
static java.lang.String convertFirstCharacterToUppercase(java.lang.String s)
          Converts the first character of a String to uppercase.
static java.lang.String fromByteToMegaOrGiga(long size)
          Given an amount of bytes, return a string representation in Bytes, Kilobytes, Megabytes or Gigabytes Examples: Given 1024 bytes -> "1KB" Given 1536 bytes -> 1.5KB"
static java.lang.String fromSecondsToHoursAndDays(long s)
          Given an amount of seconds, returns a string representation in minutes, hours and days.
static java.util.List<java.lang.String> fromStringArrayToList(java.lang.String... str)
           Returns a List containing strings of the array.
static java.lang.String getString(java.lang.Object... strings)
          Returns a string with concatenation of argument array.
static boolean isEmpty(java.lang.String s)
          Checks if a String is empty.
static java.lang.String toString(double value, int numberOfDecimals)
          Returns a double value as a string with a given number of decimal digits.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Method Detail

fromByteToMegaOrGiga

public static java.lang.String fromByteToMegaOrGiga(long size)
Given an amount of bytes, return a string representation in Bytes, Kilobytes, Megabytes or Gigabytes Examples: Given 1024 bytes -> "1KB" Given 1536 bytes -> 1.5KB"

Parameters:
size - amount of bytes
Returns:
String representation in Bytes, Kilobytes, Megabytes or Gigabytes

fromSecondsToHoursAndDays

public static java.lang.String fromSecondsToHoursAndDays(long s)
Given an amount of seconds, returns a string representation in minutes, hours and days.

Parameters:
s - seconds
Returns:
a string representation in minutes, hours and days

fromStringArrayToList

public static java.util.List<java.lang.String> fromStringArrayToList(java.lang.String... str)

Returns a List containing strings of the array. Text between " chars, are returned on a string

Example: {"This", "is\"", "a ", "test\""} will return: "This" "is" "a test"

Parameters:
str - String array
Returns:
List containing strings of the array

getString

public static java.lang.String getString(java.lang.Object... strings)
Returns a string with concatenation of argument array.

Parameters:
strings - strings
Returns:
concatenation of argument array

toString

public static java.lang.String toString(double value,
                                        int numberOfDecimals)
Returns a double value as a string with a given number of decimal digits.

Parameters:
value - double value
numberOfDecimals - number of decimal digits
Returns:
string with a given number of decimal digits

convertFirstCharacterToUppercase

public static java.lang.String convertFirstCharacterToUppercase(java.lang.String s)
Converts the first character of a String to uppercase.

Parameters:
s - A String that should be converted
Returns:
The String with the first character converted to uppercase

isEmpty

public static boolean isEmpty(java.lang.String s)
Checks if a String is empty.

Parameters:
s - A String
Returns:
If the specified String is empty


Copyright © 2006-2008 The aTunes Team. All Rights Reserved.