com.zerjio.JIRC
Class Utils

java.lang.Object
  extended bycom.zerjio.JIRC.Utils

public class Utils
extends java.lang.Object

A general utilities class. All its methods should be static.


Constructor Summary
Utils()
           
 
Method Summary
static boolean areChannelsEquivalent(java.lang.String channelName1, java.lang.String channelName2)
          Tests if two channel names are equivalent.
static boolean areNicksEquivalent(java.lang.String nick1, java.lang.String nick2)
          Tests if two nicks are equivalent.
static int countChar(char character, java.lang.String string)
          Counts the number of ocurrences of a char into a given string.
static boolean isReplyMessage(java.lang.String command)
          Checks if a command string is a reply message command (a 3 digit number).
static java.lang.String[] splitString(char separatorChar, java.lang.String string)
          Splits a given string into one or more which are separated by a given separator character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

isReplyMessage

public static boolean isReplyMessage(java.lang.String command)
Checks if a command string is a reply message command (a 3 digit number).

Returns:
true if the command corresponds to a reply message. false otherwise.

countChar

public static int countChar(char character,
                            java.lang.String string)
Counts the number of ocurrences of a char into a given string.

Parameters:
character - The character that should be count.
string - The string where the character should be counted.
Returns:
The number of ocurrences of the character into the given string.

splitString

public static java.lang.String[] splitString(char separatorChar,
                                             java.lang.String string)
Splits a given string into one or more which are separated by a given separator character.

Parameters:
separatorChar - The char which separates the different substrings
string - The string that must be splitted
Returns:
An array of strings which were on string but separated with the separatorChar.

areNicksEquivalent

public static boolean areNicksEquivalent(java.lang.String nick1,
                                         java.lang.String nick2)
Tests if two nicks are equivalent.

Parameters:
nick1 - The first nick to compare
nick2 - The second nick to compare
Returns:
true if both nicks are equivalent. false otherwise.

areChannelsEquivalent

public static boolean areChannelsEquivalent(java.lang.String channelName1,
                                            java.lang.String channelName2)
Tests if two channel names are equivalent.

Parameters:
channelName1 - The first channel name to compare
channelName2 - The second channel name to compare
Returns:
true if both channels names are equivalent. false otherwise.