public final class Branch
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static boolean |
likely(boolean expr) |
Assert that the given expression is likely, which is to say, it will be
true more than 75%
of the time. |
static boolean |
probability(float prob,
boolean expr) |
Assert that the given expression has the given probability of being
true. |
static boolean |
unlikely(boolean expr) |
Assert that the given expression is unlikely, which is to say, it will be
false more than 75%
of the time. |
static boolean |
veryLikely(boolean expr) |
Assert that the given expression is on the "fast path", which is to say, it will be
true more than 99.9%
of the time. |
static boolean |
veryUnlikely(boolean expr) |
Assert that the given expression is on the "slow path", which is to say, it will be
false more than 99.9%
of the time. |
public static boolean veryLikely(boolean expr)
true more than 99.9%
of the time.expr - the expression valuepublic static boolean veryUnlikely(boolean expr)
false more than 99.9%
of the time.expr - the expression valuepublic static boolean likely(boolean expr)
true more than 75%
of the time.expr - the expression valuepublic static boolean unlikely(boolean expr)
false more than 75%
of the time.expr - the expression valuepublic static boolean probability(float prob,
boolean expr)
true.prob - the probability where 0.0f \u2264 prob \u2264 1.0fexpr - the expression valueCopyright © 2018 JBoss, a division of Red Hat, Inc.