The Octet Molecular Representation Framework v0.8.2

net.sf.octet.util
Class StringFragmenter

java.lang.Object
  extended bynet.sf.octet.util.StringFragmenter

public class StringFragmenter
extends java.lang.Object

StringFragmeter breaks a String up into fragments. The fragmentation pattern is defined by a regular expression passed to the constructor. This class is intended to be instantiated and re-used in multiple string fragmentations to avoid re-compilation of the regex.

Author:
Richard Apodaca

Constructor Summary
StringFragmenter(java.lang.String regex)
          Creates a new StringFragmenter with the specified regular expression.
 
Method Summary
 java.lang.String[] fragment(java.lang.String string)
          Returns a String array that is composed of the fragments of string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringFragmenter

public StringFragmenter(java.lang.String regex)
Creates a new StringFragmenter with the specified regular expression.

Parameters:
regex - the regular expression
Method Detail

fragment

public java.lang.String[] fragment(java.lang.String string)
Returns a String array that is composed of the fragments of string.

Parameters:
string - the string to fragment
Returns:
the array of fragments

The Octet Molecular Representation Framework v0.8.2