Skip to content

Commit

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

Change-Id: I69b108218a127dad9ca73994de76558f977a304d
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>

Conflicts:
	src/main/org/openscience/cdk/interfaces/IBond.java
  • Loading branch information
johnmay authored and egonw committed Nov 12, 2012
1 parent 7a39faa commit b66ebfe
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions src/main/org/openscience/cdk/interfaces/IBond.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,38 @@ public interface IBond extends IElectronContainer {
*
*/
public enum Order {
SINGLE,
DOUBLE,
TRIPLE,
QUADRUPLE,
UNSET
SINGLE(1),
DOUBLE(2),
TRIPLE(3),
QUADRUPLE(4),
UNSET(0);

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
* Order.UNSET.numeric() // 0
* }</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 b66ebfe

Please sign in to comment.