Skip to content

Commit

Permalink
Javadocs and whitespace fix for Abstract Selection
Browse files Browse the repository at this point in the history
  • Loading branch information
gilleain authored and egonw committed Jun 11, 2011
1 parent ac78d0a commit 291bec0
Showing 1 changed file with 42 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.openscience.cdk.interfaces.IChemObject;

/**
* An abstract selection of chem objects.
*
* @author Arvid
* @cdk.module renderbasic
* @cdk.githash
Expand All @@ -38,41 +40,45 @@ public abstract class AbstractSelection implements IChemObjectSelection {

public static IChemObjectSelection EMPTY_SELECTION = new AbstractSelection() {

public IAtomContainer getConnectedAtomContainer() {
return null;
}

public boolean isFilled() {

return false;
}

public boolean contains(IChemObject obj) {
return false;
}

public <E extends IChemObject> Collection<E> elements(Class<E> clazz) {

return Collections.emptySet();
}


};

public void select(IChemModel chemModel) {
// TODO Auto-generated method stub

}

protected void addToAtomContainer(IAtomContainer ac, IChemObject item) {

if (item instanceof IAtomContainer) {
ac.add((IAtomContainer) item);
} else if (item instanceof IAtom) {
ac.addAtom((IAtom) item);
} else if (item instanceof IBond) {
ac.addBond((IBond) item);
}
}
public IAtomContainer getConnectedAtomContainer() {
return null;
}

public boolean isFilled() {
return false;
}

public boolean contains(IChemObject obj) {
return false;
}

public <E extends IChemObject> Collection<E> elements(Class<E> clazz) {
return Collections.emptySet();
}

};

/** {@inheritDoc} */
public void select(IChemModel chemModel) {
// TODO Auto-generated method stub

}


/**
* Utility method to add a chemobject to an atom container.
*
* @param ac the atom container to add to
* @param item the chem object to add
*/
protected void addToAtomContainer(IAtomContainer ac, IChemObject item) {
if (item instanceof IAtomContainer) {
ac.add((IAtomContainer) item);
} else if (item instanceof IAtom) {
ac.addAtom((IAtom) item);
} else if (item instanceof IBond) {
ac.addBond((IBond) item);
}
}

}

0 comments on commit 291bec0

Please sign in to comment.