Top Description Constructors Methods
org.wildfly.common

public final Class Branch

extends Object
Class Inheritance

Branch probability directives. On JVMs which support these constructs,

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

the expression value
likely
(boolean
the expression value
expr
)

Assert that the given expression is likely, which is to say, it will be true more than 75% of the time.

public static boolean

Returns:

the expression value
probability
(float
the probability where 0.0f ≤ prob ≤ 1.0f
prob
,
boolean
the expression value
expr
)

Assert that the given expression has the given probability of being true.

public static boolean

Returns:

the expression value
unlikely
(boolean
the expression value
expr
)

Assert that the given expression is unlikely, which is to say, it will be false more than 75% of the time.

public static boolean

Returns:

the expression value
veryLikely
(boolean
the expression value
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.

public static boolean

Returns:

the expression value
veryUnlikely
(boolean
the expression value
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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Branchback to summary
private Branch()

Method Detail

likelyback to summary
public 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.

Parameters
expr:boolean

the expression value

Returns:boolean

the expression value

probabilityback to summary
public static boolean probability(float prob, boolean expr)

Assert that the given expression has the given probability of being true.

Parameters
prob:float

the probability where 0.0f ≤ prob ≤ 1.0f

expr:boolean

the expression value

Returns:boolean

the expression value

unlikelyback to summary
public 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.

Parameters
expr:boolean

the expression value

Returns:boolean

the expression value

veryLikelyback to summary
public 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.

Parameters
expr:boolean

the expression value

Returns:boolean

the expression value

veryUnlikelyback to summary
public 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.

Parameters
expr:boolean

the expression value

Returns:boolean

the expression value