Package chemaxon.calculator
Interface CalculatorInputChecker
- All Superinterfaces:
- Function<Molecule,,- List<CalculatorError>> - TaggedCalculatorInputChecker
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@PublicApi
@FunctionalInterface
public interface CalculatorInputChecker
extends Function<Molecule,List<CalculatorError>>, TaggedCalculatorInputChecker 
Instances of this interface are used by calculators to check if they can process an input molecule.
 Calculators can use multiple checkers, which validate different properties of the input.
 
 This interface extends TaggedCalculatorInputChecker and implements its only method by
 delegating to apply(Molecule).
- 
Method SummaryModifier and TypeMethodDescriptiondefault List<CalculatorError> apply(TaggedCalculator calculator, Molecule molecule) Checks the given molecule and returns the found errors, or an empty list if the molecule is valid.Checks the given molecule and returns the found errors, or an empty list if the molecule is valid.static CalculatorInputCheckercombine(Collection<? extends CalculatorInputChecker> checkers) Combines the given checkers into a single one that reports all errors reported by the given checkers.static CalculatorInputCheckerheavyAtomLimit(int maximumHeavyAtoms) Creates a new input checker that only accepts molecules with at most the given number of heavy atoms.static CalculatorInputCheckerCreates a new input checker that accepts those molecules which satisfy the given lambda.
- 
Method Details- 
ofCreates a new input checker that accepts those molecules which satisfy the given lambda.- Parameters:
- errorMessage- the message of the error to report if the molecule fails the predicate
- predicate- a lambda to check the molecule
- Returns:
- the new checker
 
- 
heavyAtomLimitCreates a new input checker that only accepts molecules with at most the given number of heavy atoms.- Parameters:
- maximumHeavyAtoms- the maximum allowed number of heavy atoms in input molecules
- Returns:
- the new checker
 
- 
combineCombines the given checkers into a single one that reports all errors reported by the given checkers.- Parameters:
- checkers- the checkers to combine
- Returns:
- the new checker
 
- 
applyChecks the given molecule and returns the found errors, or an empty list if the molecule is valid.- Specified by:
- applyin interface- Function<Molecule,- List<CalculatorError>> 
- Parameters:
- molecule- the input molecule
- Returns:
- a list of found errors, typically empty or containing a single element
 
- 
applyDescription copied from interface:TaggedCalculatorInputCheckerChecks the given molecule and returns the found errors, or an empty list if the molecule is valid.Apart from the molecule that should be checked, this method also receives the calculator instance. - Specified by:
- applyin interface- TaggedCalculatorInputChecker
- Parameters:
- calculator- the calculator instance
- molecule- the input molecule
- Returns:
- a list of found errors, typically empty or containing a single element
 
 
-