public interface BindRule extends Comparable<BindRule>
RuleBasedBindingFunction
takes a collection of BindRules grouped
into their activating contexts to form a BindingFunction
.
Note: this interface's ordering is inconsistent with Object.equals(Object)
. See
compareTo(BindRule)
for more details.
BindRules
Modifier and Type | Method and Description |
---|---|
Desire |
apply(Desire desire)
Apply this BindRule to the given Desire, and return a restricted and
possibly satisfied desire.
|
int |
compareTo(BindRule other)
Compare this bind rule to another.
|
CachePolicy |
getCachePolicy()
Get the rule's cache policy.
|
EnumSet<BindingFlag> |
getFlags()
Get the flags attached to this bind rule.
|
boolean |
isTerminal()
Query whether this rule is terminal.
|
boolean |
matches(Desire desire) |
BindRuleBuilder |
newCopyBuilder()
Create a new bind rule builder initialized to copy this bind rule.
|
CachePolicy getCachePolicy()
Desire apply(Desire desire)
matches(org.grouplens.grapht.reflect.Desire)
returns true.desire
- The desire that is input to this partial binding functionboolean isTerminal()
EnumSet<BindingFlag> getFlags()
boolean matches(Desire desire)
desire
- The input desireapply(org.grouplens.grapht.reflect.Desire)
BindRuleBuilder newCopyBuilder()
BindRuleBuilder.build()
method will return a
copy of this bind rule.UnsupportedOperationException
- if the bind rule cannot be reconfigured in this manner.int compareTo(BindRule other)
Note: This implements an ordering inconsistent with Object.equals(Object)
. Equal
rules will compare the same (and implementations are required to enforce this), but unequal
rules may compare equal to each other when compared with this method.
compareTo
in interface Comparable<BindRule>
other
- The bind rule to compare with.IllegalArgumentException
- if called with an incompatible bind rule. This should not
arise in practice, but if you implement your own bind rules
they will not be comparable with the ones provided by
Grapht.Copyright © 2016 GroupLens Research. All rights reserved.