org.quasiliteral.text
Class FirstCharSplitter

java.lang.Object
  |
  +--org.quasiliteral.text.FirstCharSplitter

public class FirstCharSplitter
extends Object

Safe: Splits a string on the first occurrence of any of a set of "special" characters.

Author:
Mark S. Miller

Field Summary
private  String myRestChars
          do a linear lookup on the rest of the special
private  boolean[] mySpecialFlags
          optimize the Ascii subset into an array lookup
 
Constructor Summary
FirstCharSplitter(String specials)
          Enabled:
 
Method Summary
 int findIn(String str)
          Enabled: Return the index of the first occurrence of any of the special chars in str, or -1 if none are found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mySpecialFlags

private final boolean[] mySpecialFlags
optimize the Ascii subset into an array lookup


myRestChars

private final String myRestChars
do a linear lookup on the rest of the special

Constructor Detail

FirstCharSplitter

public FirstCharSplitter(String specials)
Enabled:

Method Detail

findIn

public int findIn(String str)
Enabled: Return the index of the first occurrence of any of the special chars in str, or -1 if none are found.



comments?