Package org.openscience.cdk.io.formats
Class IChemFormatMatcher.MatchResult
- java.lang.Object
-
- org.openscience.cdk.io.formats.IChemFormatMatcher.MatchResult
-
- All Implemented Interfaces:
Comparable<IChemFormatMatcher.MatchResult>
- Enclosing interface:
- IChemFormatMatcher
public static final class IChemFormatMatcher.MatchResult extends Object implements Comparable<IChemFormatMatcher.MatchResult>
Simple class holds whether a format matcher matched, when it matched and what the format was. The result is comparable to be prioritised (lower match position being favoured).
-
-
Constructor Summary
Constructors Constructor Description MatchResult(boolean matched, IChemFormat format, int position)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(IChemFormatMatcher.MatchResult that)
Compares the match result with another, results with lower position are ordered before those with higher position.IChemFormat
format()
What was the format which matched if there was a match (matched()
).boolean
matched()
Did the chem format match.
-
-
-
Constructor Detail
-
MatchResult
public MatchResult(boolean matched, IChemFormat format, int position)
-
-
Method Detail
-
matched
public boolean matched()
Did the chem format match.- Returns:
- whether the format matched
-
format
public IChemFormat format()
What was the format which matched if there was a match (matched()
).- Returns:
- the format which matched
- Throws:
IllegalArgumentException
- there was no match
-
compareTo
public int compareTo(IChemFormatMatcher.MatchResult that)
Compares the match result with another, results with lower position are ordered before those with higher position.- Specified by:
compareTo
in interfaceComparable<IChemFormatMatcher.MatchResult>
-
-