sbrt.shell.text.chem
Class CatalystFormatV2
java.lang.Object
sbrt.shell.text.chem.CatalystFormatV2
- All Implemented Interfaces:
- CatalystFormat, Format, Formatter<java.lang.String>, Parser<java.lang.String>, SimpleFormat<java.lang.String>
public final class CatalystFormatV2
- extends java.lang.Object
- implements CatalystFormat
This class is a concrete implementation of CatalystFormat.
This format considers catalyts to be String
objects, which
are referred to as catalyst names. Catalyst names
cannot contain any whitespace characters (spaces, tabs, or newlines)
and their length must be greater than 0.
- Author:
- This class was written and documented by
Jeremiah Wright while in the Wagner lab.
Method Summary |
java.lang.String |
format(java.lang.String catalystName)
Returns the provided catalyst name after ensuring it
conforms to this format. |
java.lang.String |
parse(java.lang.String catalystName)
Parses the provided string and returns its
corresponding catalyst name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CatalystFormatV2
public CatalystFormatV2()
format
public java.lang.String format(java.lang.String catalystName)
- Returns the provided catalyst name after ensuring it
conforms to this format.
- Specified by:
format
in interface Formatter<java.lang.String>
- Parameters:
catalystName
- the catalyst name to be checked.
- Returns:
- the provided catalyst name.
- Throws:
java.lang.NullPointerException
- if the provided
string is null
.
parse
public java.lang.String parse(java.lang.String catalystName)
- Parses the provided string and returns its
corresponding catalyst name.
- Specified by:
parse
in interface Parser<java.lang.String>
- Parameters:
catalystName
- the string to be parsed.
- Returns:
- a copy of the provided string with leading and
trailing white space removed, or the provided string if
it has no leading or trailing white space.
- Throws:
FormatException
- if the provided string
is not a valid catalyst name.
java.lang.NullPointerException
- if the provided string
is null
.