sbrt.shell.text.fba
Class RxnNameVerifier

java.lang.Object
  extended by sbrt.shell.text.fba.RxnNameVerifier
All Implemented Interfaces:
RxnNameFormat<java.lang.String>, Format, Formatter<java.lang.String>, Parser<java.lang.String>, SimpleFormat<java.lang.String>

public class RxnNameVerifier
extends java.lang.Object
implements RxnNameFormat<java.lang.String>

This class is used to ensure reaction names exist in a given Fluxome.

Author:
This class was written and documented by Jeremiah Wright while in the Wagner lab.

Constructor Summary
RxnNameVerifier(Fluxome fluxome)
          Constructs a new reaction name checker for the provided fluxome.
 
Method Summary
 java.lang.String format(java.lang.String validRxnName)
          Returns the provided reaction name after ensuring it exists in the corresponding fluxome of this reaction name checker.
 Fluxome getFluxome()
          Returns the fluxome used to create this reaction name checker.
 java.lang.String parse(java.lang.String rxnName)
          Parses the provided string and returns its corresponding reaction name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RxnNameVerifier

public RxnNameVerifier(Fluxome fluxome)
Constructs a new reaction name checker for the provided fluxome.

Parameters:
fluxome - the fluxome whose reaction names will be used for comparison.
Method Detail

getFluxome

public Fluxome getFluxome()
Returns the fluxome used to create this reaction name checker.

Returns:
the fluxome used to create this reaction name checker.

format

public java.lang.String format(java.lang.String validRxnName)
Returns the provided reaction name after ensuring it exists in the corresponding fluxome of this reaction name checker.

Specified by:
format in interface Formatter<java.lang.String>
Parameters:
validRxnName - the name of a reaction in this reaction name checker's fluxome.
Returns:
the provided reaction name after ensuring it exists in the corresponding fluxome of this reaction name checker.
Throws:
java.lang.IllegalArgumentException - if the provided string is not the name of a reaction in this reaction name checker's fluxome.

parse

public java.lang.String parse(java.lang.String rxnName)
Parses the provided string and returns its corresponding reaction name.

Specified by:
parse in interface Parser<java.lang.String>
Parameters:
rxnName - 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 reaction name in the fluxome used to create this reaction name checker.
java.lang.NullPointerException - if the provided string is null.