fr.curie.BiNoM.pathways.utils
Class PowerfulTokenizer

java.lang.Object
  extended by fr.curie.BiNoM.pathways.utils.PowerfulTokenizer
All Implemented Interfaces:
java.util.Enumeration

public class PowerfulTokenizer
extends java.lang.Object
implements java.util.Enumeration

A Powerful Tokenizer Author Bhabani Padhi Extension of the standard StringTokenizer


Constructor Summary
PowerfulTokenizer(java.lang.String str, java.lang.String sep)
          Constructor
PowerfulTokenizer(java.lang.String str, java.lang.String sep, boolean bIncludeDelim)
          Constructor
 
Method Summary
 int countTokens()
          Total number of tokens present in the input string
 boolean hasMoreElements()
          Checks whether any token is left in the input string
 boolean hasMoreTokens()
          Checks whether any token is left in the input string
static void main(java.lang.String[] args)
           
 java.lang.Object nextElement()
          Returns the next token from the input string.
 java.lang.String nextToken()
          Returns the next token from the input string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PowerfulTokenizer

public PowerfulTokenizer(java.lang.String str,
                         java.lang.String sep)
Constructor

Parameters:
str - the input string
sep - the delimiter string

PowerfulTokenizer

public PowerfulTokenizer(java.lang.String str,
                         java.lang.String sep,
                         boolean bIncludeDelim)
Constructor

Parameters:
str - the input string
sep - the delimiter string
bIncludeDelim - if true, include delimiters as tokens
Method Detail

nextToken

public java.lang.String nextToken()
Returns the next token from the input string.

Returns:
String the current token from the input string.

hasMoreTokens

public boolean hasMoreTokens()
Checks whether any token is left in the input string

Returns:
boolean true, if any token is left

hasMoreElements

public boolean hasMoreElements()
Checks whether any token is left in the input string

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
boolean true, if any token is left

nextElement

public java.lang.Object nextElement()
Returns the next token from the input string.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
Object the current token from the input string.

countTokens

public int countTokens()
Total number of tokens present in the input string

Returns:
int total number of tokens

main

public static void main(java.lang.String[] args)