/** * Clones this <code>ReactionSet</code> and the contained <code>Reaction</code>s * too. * * @return The cloned ReactionSet */ @Override public Object clone() throws CloneNotSupportedException { ReactionSet clone = (ReactionSet) super.clone(); // clone the reactions clone.reactionCount = this.reactionCount; clone.reactions = new Reaction[clone.reactionCount]; for (int f = 0; f < clone.reactionCount; f++) { clone.reactions[f] = (Reaction) ((Reaction) reactions[f]).clone(); } return clone; }
/** * Clones this <code>ReactionSet</code> and the contained <code>Reaction</code>s * too. * * @return The cloned ReactionSet */ @Override public Object clone() throws CloneNotSupportedException { ReactionSet clone = (ReactionSet) super.clone(); // clone the reactions clone.reactionCount = this.reactionCount; clone.reactions = new Reaction[clone.reactionCount]; for (int f = 0; f < clone.reactionCount; f++) { clone.reactions[f] = (Reaction) ((Reaction) reactions[f]).clone(); } return clone; }