com.sshtools.common.util

Class GeneralUtil


public final class GeneralUtil
extends java.lang.Object

Other utilities not worth their own class

Method Summary

static String
colorToString(Color color)
Return a string representation of a color
static String
encodeHTML(String html)
This method will replace '&' with "&", '"' with """, '<' with "<" and '>' with ">".
static String
numberToPaddedHexString(int number, int size)
Convert a number to a zero padded hex string
static Color
stringToColor(String s)
Return a Color object given a string representation of it

Method Details

colorToString

public static String colorToString(Color color)
Return a string representation of a color
Parameters:
color -
Returns:
string representation

encodeHTML

public static String encodeHTML(String html)
This method will replace '&' with "&", '"' with """, '<' with "<" and '>' with ">".
Parameters:
html - html to encode
Returns:
encoded html

numberToPaddedHexString

public static String numberToPaddedHexString(int number,
                                             int size)
Convert a number to a zero padded hex string
Parameters:
Returns:
zero padded hex string

stringToColor

public static Color stringToColor(String s)
Return a Color object given a string representation of it
Parameters:
Returns:
string representation

Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.