spellcast.util
Class TextUtil

java.lang.Object
  extended by spellcast.util.TextUtil

public abstract class TextUtil
extends java.lang.Object

Miscellaneous text utilities for Spellcast strings.

Author:
Barrie Treloar

Method Summary
static java.lang.String getGameName(java.lang.String line)
          From a line from GameNames.txt return the game name or null if the line is malformed.
static java.lang.String getGender(java.lang.String line)
          From a line from Profiles.txt return the Gender string.
static java.lang.String getIPAddress(java.lang.String serverAddressString)
          From a string of the form [:] return the host.
static int getNumberOfUses(java.lang.String line)
          From a line from GameNames.txt return the numberOfUses or -1 if the line is malformed.
static int getPort(java.lang.String serverAddressString)
          From a string of the form [:] return the port.
static java.lang.String getWizardName(java.lang.String line)
          From a line from Profiles.txt return the Wizard Name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getGender

public static java.lang.String getGender(java.lang.String line)
From a line from Profiles.txt return the Gender string.

Parameters:
line - a lone of the format
Returns:
the gender or null if the line is malformed.

getWizardName

public static java.lang.String getWizardName(java.lang.String line)
From a line from Profiles.txt return the Wizard Name.

Parameters:
line - a lone of the format
Returns:
the wizard name or null if the line is malformed.

getNumberOfUses

public static int getNumberOfUses(java.lang.String line)
From a line from GameNames.txt return the numberOfUses or -1 if the line is malformed.

Parameters:
line - a line of the format
Returns:
the from the line or -1 if the line is malformed.

getGameName

public static java.lang.String getGameName(java.lang.String line)
From a line from GameNames.txt return the game name or null if the line is malformed.

Parameters:
line - a line of the format
Returns:
the from the line or null if the line is malformed.

getIPAddress

public static java.lang.String getIPAddress(java.lang.String serverAddressString)
From a string of the form [:] return the host.

Parameters:
serverAddress - a string of the form [:]
Returns:
the host part from the serverAddress string

getPort

public static int getPort(java.lang.String serverAddressString)
From a string of the form [:] return the port. If there is no port or an error during conversion then -1 is returned.

Parameters:
serverAddressString - a string of the form [:]
Returns:
the port of the serverAddressString or -1 if not present, or malformed


Copyright © 2001-2005 Spellcast. All Rights Reserved.