matttproud/java_quantile_estimation — pull request #4 by matttproud (2014-04-09 12:30:15+00:00)
Title: Use ``null`` as unified no-samples-exist sentinel.

The original upstream library had two conditions for requesting
a quantile from an estimator that lacked values: (1) raise a null
pointer exception from the bowels of the computation or (2) return 0.
Neither of these behaviors were desirable. When I formalized this
package for Maven, I updated the protocol to emit an
IllegalStateException as a unified approach to this, which while
highly imperfect was an improvement to say, "you probably violated
some assumption about the state of your application." This is
suboptimal since it results in an unchecked and undocumented exception
and adds extra runtime overhead.

If the library solely worked with a single type as opposed to using
generics, I would support Double and use Double.NaN as a sentinel
value for an impossible computation, since NaN can convey missing
value. Since we are using generics, a @Nullable emission is OK
provided the protocol documents it, which it does.