Implementations should be immutable, such that the meaning of a predicate never changes once constructed. They should ensure their immutable promise by defensively copying any structures which might be modified externally, but was passed into the object's constructor.
However, implementations may retain non-thread-safe caches internally, to speed up evaluation operations within the context of one thread's evaluation of the predicate. As a result, callers should assume predicates are not thread-safe, but that two predicate graphs produce the same results given the same inputs if they are {@link #equals(Object)}.
Predicates should support deep inspection whenever possible, so that generic algorithms can be written to operate against them. Predicates which contain other predicates should override {@link #getChildren()} to return the list ofchildren nested within the predicate.
@type
|
|