sbrt.shell.text.chem
Class RevRxnFormatV2

java.lang.Object
  extended by sbrt.shell.text.chem.RevRxnFormatV2
All Implemented Interfaces:
Format, Formatter<ReversibleRxn>, Parser<ReversibleRxn>, SimpleFormat<ReversibleRxn>

public final class RevRxnFormatV2
extends java.lang.Object
implements SimpleFormat<ReversibleRxn>

This class is used to format reversible chemical reactions.

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

Field Summary
static java.lang.String ARROW
          The arrow used to signify a reversible reaction.
 
Constructor Summary
RevRxnFormatV2()
          Constructs a new reversible reaction format.
 
Method Summary
 java.lang.String format(ReversibleRxn rxn)
          Returns a formatted string representation of the provided reversible chemical reaction.
 ChemSpeciesFormatV1 getChemSpeciesFormat()
          Returns the format used for chemical species.
 LinearCombFormatV2<java.lang.String> getLinearCombFormat()
          Returns the format used for stoichiometric expressions.
 ReversibleRxn parse(java.lang.String reaction)
          Parses the provided string and returns its corresponding chemical reaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARROW

public static final java.lang.String ARROW
The arrow used to signify a reversible reaction.

See Also:
Constant Field Values
Constructor Detail

RevRxnFormatV2

public RevRxnFormatV2()
Constructs a new reversible reaction format.

Method Detail

getChemSpeciesFormat

public ChemSpeciesFormatV1 getChemSpeciesFormat()
Returns the format used for chemical species.

Returns:
the format used for chemical species.

getLinearCombFormat

public LinearCombFormatV2<java.lang.String> getLinearCombFormat()
Returns the format used for stoichiometric expressions.

Returns:
the format used for stoichiometric expressions.

format

public java.lang.String format(ReversibleRxn rxn)
Returns a formatted string representation of the provided reversible chemical reaction.

Specified by:
format in interface Formatter<ReversibleRxn>
Parameters:
rxn - the reaction to be formatted.
Returns:
a formatted string representation of the provided reversible chemical reaction.

parse

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

Specified by:
parse in interface Parser<ReversibleRxn>
Parameters:
reaction - the string to be parsed.
Returns:
the chemical reaction corresponding to the provided string. The type of this reaction will be either IrrevRxn, SourceRxn, or SinkRxn.