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 b6ed6a7 commit 5bef796
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/org/openscience/cdk/AtomContainer.java
Expand Up @@ -568,7 +568,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 @@ -1583,7 +1583,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/Bond.java
Expand Up @@ -152,7 +152,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
10 changes: 5 additions & 5 deletions src/main/org/openscience/cdk/ReactionSet.java
Expand Up @@ -91,7 +91,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 @@ -133,7 +133,7 @@ public void removeReaction(int pos) {
* @return The Reaction at position <code>number</code>
*/
public IReaction getReaction(int number) {
return (Reaction)reactions[number];
return reactions[number];
}


Expand Down Expand Up @@ -180,7 +180,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 Expand Up @@ -217,9 +217,9 @@ public Object clone() throws CloneNotSupportedException {
ReactionSet clone = (ReactionSet)super.clone();
// clone the reactions
clone.reactionCount = this.reactionCount;
clone.reactions = new Reaction[clone.reactionCount];
clone.reactions = new IReaction[clone.reactionCount];
for (int f = 0; f < clone.reactionCount; f++) {
clone.reactions[f] = (Reaction)((Reaction)reactions[f]).clone();
clone.reactions[f] = (IReaction)((IReaction)reactions[f]).clone();
}
return clone;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/org/openscience/cdk/SingleElectron.java
Expand Up @@ -97,7 +97,7 @@ public Integer getElectronCount() {
* @see #setAtom
*/
public IAtom getAtom() {
return (Atom)this.atom;
return this.atom;
}

/**
Expand Down

0 comments on commit 5bef796

Please sign in to comment.