- java.lang.Object
-
- com.pervasive.datarush.test.FloatingPointMismatchFilter
-
- All Implemented Interfaces:
Assertions.MismatchFilter
public class FloatingPointMismatchFilter extends Object implements Assertions.MismatchFilter
A filter for handling mismatches in floating point values. Errors within a specified tolerance are ignored.
-
-
Field Summary
-
Fields inherited from interface com.pervasive.datarush.commons.test.Assertions.MismatchFilter
IGNORE_SORT_ORDER, NO_FILTER
-
-
Constructor Summary
Constructors Constructor Description FloatingPointMismatchFilter(FloatingPointTolerance tolerance, String separator)
Declares a filter using the specified tolerance range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
ignoreMismatch(String expected, String actual)
Indicates whether the specified mismatch should be ignored for comparison purposed.boolean
ignoreSortOrder()
Indicates whether the filter should ignore sort order
-
-
-
Constructor Detail
-
FloatingPointMismatchFilter
public FloatingPointMismatchFilter(FloatingPointTolerance tolerance, String separator)
Declares a filter using the specified tolerance range. The line is assumed to consist of floating point values separated by the given separator.- Parameters:
tolerance
- the permitted degree of error in valuesseparator
- the character sequence separating field values
-
-
Method Detail
-
ignoreMismatch
public boolean ignoreMismatch(String expected, String actual)
Description copied from interface:Assertions.MismatchFilter
Indicates whether the specified mismatch should be ignored for comparison purposed.- Specified by:
ignoreMismatch
in interfaceAssertions.MismatchFilter
- Parameters:
expected
- the expected lineactual
- the actual line found- Returns:
true
if the mismatch is not significant,false
if it is.
-
ignoreSortOrder
public boolean ignoreSortOrder()
Description copied from interface:Assertions.MismatchFilter
Indicates whether the filter should ignore sort order- Specified by:
ignoreSortOrder
in interfaceAssertions.MismatchFilter
- Returns:
- whether the filter should ignore sort order
-
-