Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added a field to the bond order enumeration allow access to the numer…
…ic value for that order.

Change-Id: I69b108218a127dad9ca73994de76558f977a304d
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
johnmay authored and egonw committed Nov 12, 2012
1 parent 7d5ce83 commit 8c34bfe
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions src/main/org/openscience/cdk/interfaces/IBond.java
Expand Up @@ -46,12 +46,36 @@ public interface IBond extends IElectronContainer {
*
*/
public enum Order {
SINGLE,
DOUBLE,
TRIPLE,
QUADRUPLE
SINGLE(1),
DOUBLE(2),
TRIPLE(3),
QUADRUPLE(4);

private final Integer bondedElectronPairs;

private Order(Integer bondedElectronPairs){
this.bondedElectronPairs = bondedElectronPairs;
}

/**
* Access a numeric value for the number of bonded electron pairs.
* <p/>
* <pre>{@code
* Order.SINGLE.numeric() // 1
* Order.DOUBLE.numeric() // 2
* Order.TRIPLE.numeric() // 3
* Order.QUADRUPLE.numeric() // 4
* }</pre>
*
* @return number of bonded electron pairs
*/
public Integer numeric(){
return bondedElectronPairs;
}

}



/**
* Enumeration of possible stereo types of two-atom bonds. The
* Stereo type defines not just define the stereochemistry, but also the
Expand Down

0 comments on commit 8c34bfe

Please sign in to comment.