org.melati.util
Class CSVStringEnumeration

java.lang.Object
  extended by org.melati.util.CSVStringEnumeration
All Implemented Interfaces:
java.util.Enumeration

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

A utility for tokenising a string made up of comma-separated variables. Unlike Tim's effort, it handles quoted variables as well.

   foo, bar om,,"baz, ,oof",xyz,   ->
     "foo", " bar om", "", "baz, , oof", "xyz", ""
 

Author:
williamc@paneris.org

Constructor Summary
CSVStringEnumeration()
           
 
Method Summary
 boolean hasMoreElements()
          Are there any more tokens to come?
 java.lang.Object nextElement()
          Return the next token as an Object.
 java.lang.String nextToken()
           
 void reset(java.lang.String lineP)
          Look at a new string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVStringEnumeration

public CSVStringEnumeration()
Method Detail

reset

public void reset(java.lang.String lineP)
Look at a new string.


hasMoreElements

public boolean hasMoreElements()
Are there any more tokens to come?

Specified by:
hasMoreElements in interface java.util.Enumeration
See Also:
Enumeration.hasMoreElements()

nextElement

public final java.lang.Object nextElement()
Return the next token as an Object.

Specified by:
nextElement in interface java.util.Enumeration
See Also:
Enumeration.nextElement()

nextToken

public java.lang.String nextToken()
Returns:
the next token as a String.


Copyright © 2000-2008 PanEris. All Rights Reserved.