Skip to content

Commit

Permalink
Use interfaces instead of implementations
Browse files Browse the repository at this point in the history
Signed-off-by: Rajarshi  Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw authored and rajarshi committed Nov 7, 2011
1 parent fbfdd14 commit b6ed6a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/org/openscience/cdk/silent/AtomContainer.java
Expand Up @@ -546,7 +546,7 @@ public IAtom getFirstAtom()
*/
public IAtom getLastAtom()
{
return getAtomCount() > 0 ? (Atom)atoms[getAtomCount() - 1] : null;
return getAtomCount() > 0 ? (IAtom)atoms[getAtomCount() - 1] : null;
}


Expand Down Expand Up @@ -1530,7 +1530,7 @@ public Object clone() throws CloneNotSupportedException {
clone.removeAllElements();
// clone all atoms
for (int f = 0; f < getAtomCount(); f++) {
clone.addAtom((Atom) getAtom(f).clone());
clone.addAtom((IAtom) getAtom(f).clone());
}
// clone bonds
IBond bond;
Expand Down
2 changes: 1 addition & 1 deletion src/main/org/openscience/cdk/silent/Bond.java
Expand Up @@ -149,7 +149,7 @@ public Bond(IAtom[] atoms, Order order) {
* @param stereo a descriptor the stereochemical orientation of this bond
*/
public Bond(IAtom atom1, IAtom atom2, Order order, IBond.Stereo stereo) {
atoms = new Atom[2];
atoms = new IAtom[2];
atoms[0] = atom1;
atoms[1] = atom2;
this.order = order;
Expand Down
6 changes: 3 additions & 3 deletions src/main/org/openscience/cdk/silent/ReactionSet.java
Expand Up @@ -86,7 +86,7 @@ public class ReactionSet extends ChemObject implements Serializable, IReactionSe
*/
public ReactionSet() {
reactionCount = 0;
reactions = new Reaction[growArraySize];
reactions = new IReaction[growArraySize];
}


Expand Down Expand Up @@ -125,7 +125,7 @@ public void removeReaction(int pos) {
* @return The Reaction at position <code>number</code>
*/
public IReaction getReaction(int number) {
return (Reaction)reactions[number];
return (IReaction)reactions[number];
}


Expand Down Expand Up @@ -172,7 +172,7 @@ public void remove() {
*/
private void growReactionArray() {
growArraySize = reactions.length;
Reaction[] newreactions = new Reaction[reactions.length + growArraySize];
IReaction[] newreactions = new IReaction[reactions.length + growArraySize];
System.arraycopy(reactions, 0, newreactions, 0, reactions.length);
reactions = newreactions;
}
Expand Down

0 comments on commit b6ed6a7

Please sign in to comment.