|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.StringUtil
public class StringUtil
Classe contenant un ensemle de methode static utiles pour la manipulation des chaine de caractere mais qui ne sont pas defini dans la classe String de Java.
| Field Summary | |
|---|---|
protected static double[] |
memoryFactors
|
protected static String[] |
memoryUnites
|
protected static double[] |
timeFactors
|
protected static String[] |
timeUnites
|
| Constructor Summary | |
|---|---|
protected |
StringUtil()
Constructor for the StringUtil object |
| Method Summary | |
|---|---|
static String |
asHex(byte[] hash)
Turns array of bytes into string representing each byte as unsigned hex number. |
static String |
capitalize(String word)
Deprecated. you must use org.apache.commons.lang.StringUtils.capitalise(String) |
static boolean |
checkEnclosure(String txt,
char opener,
char closer)
Vérifie q'une chaine de caractère est valid pour les bloc openner closer, ie. |
static String |
convert(long value,
double[] factors,
String[] unites)
Note: this method use the current locale (the Locale.getDefault()) in the method
MessageFormat.MessageFormat(String). |
static String |
convertMemory(long value)
|
static String |
convertTime(long value)
|
static String |
convertTime(long value,
long value2)
|
static String |
convertToConstantName(String name)
Convertir un nom en une constante Java Les seuls caractères autorisés sont les alpha numériques, ains que l'underscore. tous les autres caractères seront ignorés. |
static String |
encodeMD5(String toEncode)
Convert a String to MD5 |
static String[] |
split(Character[] openingChars,
Character[] closingChars,
String args,
String separator)
Split string use 'separator' as separator. |
static String[] |
split(String stringList)
Use to split string array representation in array according with swixat seperator list |
static String[] |
split(String args,
String separator)
Split string use 'separator' as separator. |
static String |
substring(String s,
int begin)
|
static String |
substring(String s,
int begin,
int end)
|
static boolean[] |
toArrayBoolean(String... s)
|
static byte[] |
toArrayByte(String... s)
|
static char[] |
toArrayChar(String... s)
|
static double[] |
toArrayDouble(String... s)
|
static float[] |
toArrayFloat(String... s)
|
static int[] |
toArrayInt(String... s)
|
static long[] |
toArrayLong(String... s)
|
static short[] |
toArrayShort(String... s)
|
static boolean |
toBoolean(String s)
|
static byte |
toByte(String s)
|
static char |
toChar(String s)
|
static Color |
toColor(String s)
Essai de convertir une chaine de caractere en une couleur si possible si ce n'est pas possible retourne null. |
static Date |
toDate(String s)
|
static double |
toDouble(String s)
|
static float |
toFloat(String s)
|
static int |
toInt(String s)
|
static long |
toLong(String s)
|
static short |
toShort(String s)
|
static String |
unaccent(String s)
Cette methode retire les accents. |
static String |
uncapitalize(String word)
Deprecated. you must use org.apache.commons.lang.StringUtils.uncapitalise(String) |
static String |
unsplit(String[] s,
String sep)
Deprecated. you must use org.apache.commons.lang.StringUtils.join |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final double[] timeFactors
protected static final String[] timeUnites
protected static final double[] memoryFactors
protected static final String[] memoryUnites
| Constructor Detail |
|---|
protected StringUtil()
| Method Detail |
|---|
public static String unaccent(String s)
s - la chaine a unaccentuer
public static String substring(String s,
int begin)
public static String substring(String s,
int begin,
int end)
@Deprecated public static String capitalize(String word)
word - La chaine a capitaliser
@Deprecated public static String uncapitalize(String word)
word - La chaine a decapitaliser
@Deprecated
public static String unsplit(String[] s,
String sep)
s - le tableau de chainessep - le separateur a utiliser pour separer chaque chaine.
public static String[] split(String args,
String separator)
args - string to splitseparator - separator use to split string
public static String[] split(String stringList)
stringList - string that represent array
public static String[] split(Character[] openingChars,
Character[] closingChars,
String args,
String separator)
openingChar closingChars
this method count the number of open char end close char to split
correctly argument
openingChars - list of opening caracteresclosingChars - list of closing caracteresargs - string to splitseparator - separator use to split string
public static boolean toBoolean(String s)
public static byte toByte(String s)
public static double toDouble(String s)
public static float toFloat(String s)
public static long toLong(String s)
public static short toShort(String s)
public static int toInt(String s)
public static char toChar(String s)
public static boolean[] toArrayBoolean(String... s)
public static byte[] toArrayByte(String... s)
public static double[] toArrayDouble(String... s)
public static float[] toArrayFloat(String... s)
public static long[] toArrayLong(String... s)
public static short[] toArrayShort(String... s)
public static int[] toArrayInt(String... s)
public static char[] toArrayChar(String... s)
public static String asHex(byte[] hash)
hash - Array of bytes to convert to hex-string
public static Color toColor(String s)
throws StringUtilException
s - la couleur sous la forme de string, par exemple "red",
"yellow" ou bien en RGB "#FFAA99", et avec un canal alpha
"#FFAA3366"
IllegalArgumentException
StringUtilException - if any problem while conversion
public static Date toDate(String s)
throws ParseException
ParseExceptionpublic static String convertTime(long value)
value -
convert(long, double[], String[])
public static String convertTime(long value,
long value2)
value - value2 -
convert(long, double[], String[])public static String convertMemory(long value)
value -
convert(long, double[], String[])
public static String convert(long value,
double[] factors,
String[] unites)
Locale.getDefault()) in the method
MessageFormat.MessageFormat(String).
value - factors - unites -
public static boolean checkEnclosure(String txt,
char opener,
char closer)
txt - txte a verifieropener - le caractère ouvrantcloser - le caractère fermant
true is la chaine est validepublic static String convertToConstantName(String name)
name - le nom à convertir
public static String encodeMD5(String toEncode)
throws NoSuchAlgorithmException
toEncode - string concerned
NoSuchAlgorithmException - if could not found algorithm MD5
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||