PHD Computer Consultants Ltd
... PHD Utilities Java Classes
Last modified: 6 March 1997.

This page documents PHDUtils.class and PHDStringTokenizer.class.
It documents the public APIs open to other Java programmers.

PHDUtils.class

PHDUtils.class version 1.2.4.

Details of how a user should specify parameters.

Methods

Version

returns a string with the version number

public static String Version()

getNoSpacesParameter

Get the named parameter and strip it of spaces

public static String getNoSpacesParameter( Applet applet, String ParamName)

getIntParameter

Get the named parameter and retrieve an integer
Just return def as default if any errors

public static int getIntParameter( Applet applet, String ParamName, int def)

parseColour

Parse a colour string, in format described above.
		return defaultColour if needed

public static Color parseColour( String strColour, Color defaultColour)

getBgColour

Get a background colour from parameter or default,
ie from parameter "bgcolor" or "bgcolour"

public static Color getBgColour( Applet applet, Color defaultColour)

getFgColour

Get a foreground colour from parameter or default,
ie from parameter "fgcolor" or "fgcolour"

public static Color getFgColour( Applet applet, Color defaultColour)

StripString

Strip characters from From
Characters to strip are in Strip
return stripped string

public static String StripString( String From, String Strip)

getCStringParameter

Gets a string parameter or default, decoding C style escape codes, as described above.
NB The default is not decoded.

public static String getCStringParameter( Applet applet, String ParamName, String defaultString)

getFontParameter

Get a font from parameter or default, in format described above.

public static Font getFontParameter( Applet applet, String ParamName, Font defaultFont)

ShowInfo

Paint text lines, word wrapping and respecting line ends.
If BgColour is null then the background is not cleared.
The second form below returns the largest y reached.

public static void ShowInfo( Component c, Graphics g, String lbl, Color BgColour, Color FgColour)
public static int ShowInfo( Rectangle bounds, Graphics g, String lbl, Color BgColour, Color FgColour)
Version History
1.2.4 ShowInfo doesn't clear if BgColour null
1.2.3 ShowInfo uses bounds. New variant added
1.2.2 getCString uses u instead of h
1.2 getCStringParameter() added
1.1 Version() and getFontParameter() added

PHDStringTokenizer.class

PHDStringTokenizer.class version 1.1.

PHDStringTokenizer is similar to StringTokenizer. It has fewer methods and does not implement Enumeration.
More importantly only one delimiter is skipped at a time, eg if ";" is the delimiter then "a;;c" has 3 tokens.

Methods

Version

returns a string with the version number

public static String Version()

Other methods

public PHDStringTokenizer( String _str, String delim, boolean alwaysTrim)
public PHDStringTokenizer( String _str, String delim)
public PHDStringTokenizer( String str)
public boolean hasMoreTokens()
public String nextToken()
Version History
1.1 alwaysTrim added
1.0 Created

PHD Home page.

PHD Computer Consultants Ltd makes no representations or warranties about the suitability of the software, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. PHD Computer Consultants Ltd shall not be liable for any damages suffered by a user as a result of using, modifying or distributing the software or its derivatives.