Top Description Constructors Methods
org.hamcrest.number

public final Class IsNaN

extends TypeSafeMatcher<Double>
Class Inheritance
Imports
org.hamcrest.Description, .Matcher, .TypeSafeMatcher

Is the value a number actually not a number (NaN)?

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
describeMismatchSafely(Double item, Description mismatchDescription)

Overrides org.hamcrest.TypeSafeMatcher.describeMismatchSafely.

Subclasses should override this.
public void
describeTo(Description
The description to be built or appended to.
description
)

Implements org.hamcrest.SelfDescribing.describeTo.

Generates a description of the object.
public boolean
matchesSafely(Double item)

Implements abstract org.hamcrest.TypeSafeMatcher.matchesSafely.

Subclasses should implement this.
public static Matcher<Double>
notANumber()

Creates a matcher of Doubles that matches when an examined double is not a number.

Inherited from org.hamcrest.TypeSafeMatcher:
describeMismatchmatches

Constructor Detail

IsNaNback to summary
private IsNaN()

Method Detail

describeMismatchSafelyback to summary
public void describeMismatchSafely(Double item, Description mismatchDescription)

Overrides org.hamcrest.TypeSafeMatcher.describeMismatchSafely.

Doc from org.hamcrest.TypeSafeMatcher.describeMismatchSafely.

Subclasses should override this. The item will already have been checked for the specific type and will never be null.

Annotations
@Override
describeToback to summary
public void describeTo(Description description)

Implements org.hamcrest.SelfDescribing.describeTo.

Doc from org.hamcrest.SelfDescribing.describeTo.

Generates a description of the object. The description may be part of a a description of a larger object of which this is just a component, so it should be worded appropriately.

Parameters
description:Description

The description to be built or appended to.

Annotations
@Override
matchesSafelyback to summary
public boolean matchesSafely(Double item)

Implements abstract org.hamcrest.TypeSafeMatcher.matchesSafely.

Doc from org.hamcrest.TypeSafeMatcher.matchesSafely.

Subclasses should implement this. The item will already have been checked for the specific type and will never be null.

Annotations
@Override
notANumberback to summary
public static Matcher<Double> notANumber()

Creates a matcher of Doubles that matches when an examined double is not a number. For example:

assertThat(Double.NaN, is(notANumber()))