public final class HjExpression extends Object
HjFuture
instances. Boolean expressions can contain AND, OR, and NOT clauses. Expressions can also
be made to evaluate in strict or short-circuit mode.
Using the short-circuit mode (an expression that does not contain a NOT operation) allows the boolean expression to
be evaluated after some of the dependent HjFuture
instances have been resolved.
Using the strict mode (an expression that contains at least one NOT operation) enforces the constraint that the
boolean expression may only be evaluated safely after all the dependent HjFuture
instances
have been resolved.
Modifier and Type | Class and Description |
---|---|
static class |
HjExpression.HjAwaitExpression
An HjAwaitExpression represents an expression that can be used as the trigger clauses in asyncWhen() constructs.
|
static class |
HjExpression.HjBooleanExpression
The parent class for all boolean expressions.
|
public static HjExpression.HjAwaitExpression awaitExpr(HjExpression.HjBooleanExpression expression)
HjExpression.HjAwaitExpression
expression
- The boolean expression to wrap.HjExpression.HjAwaitExpression
strict instance.public static HjExpression.HjBooleanExpression and(HjFuture<?>[] futures)
HjExpression.HjBooleanExpression
representing an AND expression tree.futures
- The HjFuture
instances to merge into an AND.HjExpression.HjBooleanExpression
representing an AND expression tree.public static HjExpression.HjBooleanExpression and(HjExpression.HjBooleanExpression left, HjExpression.HjBooleanExpression right)
HjExpression.HjBooleanExpression
representing an AND expression.left
- The left sub-expression.right
- The right sub-expression.HjExpression.HjBooleanExpression
representing an AND expression.public static HjExpression.HjBooleanExpression leaf(HjFuture<?> aFuture)
HjExpression.HjBooleanExpression
wrapping an HjFuture
instance.aFuture
- The HjFuture
instance to wrap.HjExpression.HjBooleanExpression
wrapping an HjFuture
instance.public static HjExpression.HjBooleanExpression or(HjFuture<?>[] futures)
HjExpression.HjBooleanExpression
representing an OR expression tree.futures
- The HjFuture
instances to merge into an OR.HjExpression.HjBooleanExpression
representing an OR expression tree.public static HjExpression.HjBooleanExpression or(HjExpression.HjBooleanExpression left, HjExpression.HjBooleanExpression right)
HjExpression.HjBooleanExpression
representing an OR expression.left
- The left sub-expression.right
- The right sub-expression.HjExpression.HjBooleanExpression
representing an OR expression.public static HjExpression.HjBooleanExpression and(HjFuture<?> left, HjFuture<?> right)
HjExpression.HjBooleanExpression
representing an AND expression.left
- The left HjFuture
instance.right
- The right HjFuture
instance.HjExpression.HjBooleanExpression
representing an AND expression.public static HjExpression.HjBooleanExpression or(HjFuture<?> left, HjFuture<?> right)
HjExpression.HjBooleanExpression
representing an OR expression.left
- The left HjFuture
instance.right
- The right HjFuture
instance.HjExpression.HjBooleanExpression
representing an OR expression.public static HjExpression.HjBooleanExpression not(HjFuture<?> arg)
HjExpression.HjBooleanExpression
representing a NOT expression.arg
- The HjFuture
instance to negate.HjExpression.HjBooleanExpression
representing a NOT expression.public static HjExpression.HjBooleanExpression not(HjExpression.HjBooleanExpression arg)
HjExpression.HjBooleanExpression
representing a NOT expression.arg
- The sub-expression to negate.HjExpression.HjBooleanExpression
representing a NOT expression.public static HjExpression.HjBooleanExpression countEqualTo(HjFuture<?>[] futures, int count)
HjExpression.HjBooleanExpression
representing a COUNT(futures) == count
expression.futures
- The HjFuture
instances involved in the count expression.count
- The target count to compare againstHjExpression.HjBooleanExpression
representing a COUNT(futures) == count
expression.public static HjExpression.HjBooleanExpression countGreaterThan(HjFuture<?>[] futures, int count)
HjExpression.HjBooleanExpression
representing a COUNT(futures) > count
expression.futures
- The HjFuture
instances involved in the count expression.count
- The target count to compare againstHjExpression.HjBooleanExpression
representing a COUNT(futures) > count
expression.public static HjExpression.HjBooleanExpression countGreaterOrEqualTo(HjFuture<?>[] futures, int count)
HjExpression.HjBooleanExpression
representing a COUNT(futures) >= count
expression.futures
- The HjFuture
instances involved in the count expression.count
- The target count to compare againstHjExpression.HjBooleanExpression
representing a COUNT(futures) >= count
expression.public static HjExpression.HjBooleanExpression countLesserThan(HjFuture<?>[] futures, int count)
HjExpression.HjBooleanExpression
representing a COUNT(futures) < count
expression.futures
- The HjFuture
instances involved in the count expression.count
- The target count to compare againstHjExpression.HjBooleanExpression
representing a COUNT(futures) < count
expression.public static HjExpression.HjBooleanExpression countLesserOrEqualTo(HjFuture<?>[] futures, int count)
HjExpression.HjBooleanExpression
representing a COUNT(futures) <= count
expression.futures
- The HjFuture
instances involved in the count expression.count
- The target count to compare againstHjExpression.HjBooleanExpression
representing a COUNT(futures) <= count
expression.Copyright © 2015 Rice University - Department of Computer Science. All rights reserved.