Package mgui.util

Class PowerfulTokenizer

java.lang.Object
mgui.util.PowerfulTokenizer
All Implemented Interfaces:
java.util.Enumeration

public class PowerfulTokenizer
extends java.lang.Object
implements java.util.Enumeration
  • Constructor Summary

    Constructors
    Constructor Description
    PowerfulTokenizer​(java.lang.String str, java.lang.String sep)
    Constructor
    PowerfulTokenizer​(java.lang.String str, java.lang.String sep, boolean bIncludeDelim)
    Constructor
  • Method Summary

    Modifier and Type Method Description
    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

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Enumeration

    asIterator
  • Constructor Details

    • 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 Details

    • 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)