sbrt.kernel.fba
Class AbstractRxn

java.lang.Object
  extended by sbrt.kernel.fba.AbstractRxn
All Implemented Interfaces:
ChemRxn
Direct Known Subclasses:
IrrevRxn, RevRxn

public abstract class AbstractRxn
extends java.lang.Object
implements ChemRxn

This class is a skeleton implementation of ChemicalRxn. It performs basic functions that are useful for most classes implementing ChemicalRxn.

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

Constructor Summary
AbstractRxn(LinearComb<java.lang.String> reactants, LinearComb<java.lang.String> products)
          Constructs a new chemical reaction from the provided reactants and products with the given name.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns obj == this.
 LinearComb<java.lang.String> getProducts()
          Returns the products of this reaction.
 LinearComb<java.lang.String> getReactants()
          Returns the reactants of this reaction.
 int hashCode()
          Returns a content-based hash code for this reaction.
abstract  java.lang.String toString()
          Returns an appropriate string representation of this reaction.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface sbrt.kernel.fba.ChemRxn
isReversible
 

Constructor Detail

AbstractRxn

public AbstractRxn(LinearComb<java.lang.String> reactants,
                   LinearComb<java.lang.String> products)
Constructs a new chemical reaction from the provided reactants and products with the given name.

Parameters:
reactants - the linear combination of chemical species representing the "left-hand side" of the reaction.
products - the linear combination of chemical species representing the "right-hand side" of the reaction.
Throws:
java.lang.NullPointerException - if the reactants or products are null, or if any chemical species within them is null.
java.lang.IllegalArgumentException - if

• the reactants or products contain a chemical species in common,

• either linear combination contains a non-zero constant,

• a stoichiometric coefficient is NaN, infinite, or ≤ 0.

Method Detail

getReactants

public final LinearComb<java.lang.String> getReactants()
Returns the reactants of this reaction.

Specified by:
getReactants in interface ChemRxn
Returns:
the reactants of this reaction.

getProducts

public final LinearComb<java.lang.String> getProducts()
Returns the products of this reaction.

Specified by:
getProducts in interface ChemRxn
Returns:
the products of this reaction.

toString

public abstract java.lang.String toString()
Returns an appropriate string representation of this reaction.

Specified by:
toString in interface ChemRxn
Overrides:
toString in class java.lang.Object
Returns:
an appropriate string representation of this reaction.

hashCode

public int hashCode()
Returns a content-based hash code for this reaction.

Specified by:
hashCode in interface ChemRxn
Overrides:
hashCode in class java.lang.Object
Returns:
a content-based hash code for this reaction.

equals

public boolean equals(java.lang.Object obj)
Returns obj == this.

Specified by:
equals in interface ChemRxn
Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
obj == this.