org.hamcrest.number
Class IsCloseTo
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<java.lang.Double>
org.hamcrest.number.IsCloseTo
- All Implemented Interfaces:
- Matcher<java.lang.Double>, SelfDescribing
public class IsCloseTo
- extends TypeSafeMatcher<java.lang.Double>
Is the value a number equal to a value within some range of
acceptable error?
|
Constructor Summary |
IsCloseTo(double value,
double error)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
IsCloseTo
public IsCloseTo(double value,
double error)
matchesSafely
public boolean matchesSafely(java.lang.Double item)
- Specified by:
matchesSafely in class TypeSafeMatcher<java.lang.Double>
describeMismatchSafely
public void describeMismatchSafely(java.lang.Double item,
Description mismatchDescription)
- Overrides:
describeMismatchSafely in class TypeSafeMatcher<java.lang.Double>
describeTo
public void describeTo(Description description)
closeTo
public static Matcher<java.lang.Double> closeTo(double operand,
double error)
Copyright © 2010. All Rights Reserved.