Class ElementComparator
java.lang.Object
org.openscience.cdk.tools.ElementComparator
- All Implemented Interfaces:
Comparator<String>
Compares elements based on the order commonly used in
molecular formula. Order:
C, H, other elements in alphabetic order.
- Keywords:
- element, sorting
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, max, min, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
ElementComparator
public ElementComparator()
-
-
Method Details
-
compare
Returns a negative if o1 comes before o2 in a molecular formula, returns zero if they are identical, and positive if o1 comes after o2 in the formula.- Specified by:
comparein interfaceComparator<String>
-