Material - The type of material to work with.W - The concrete type of work being performed.public interface Work<Material,W extends Work<Material,W>>
A unit of work that can be applied to the given type of material, or combined with other like-typed units of work.
These types of work must exhibit a number of properties, for their use in the WorkSync to be correct:
a.combine(b) = b.combine(a)
a.combine(b.combine(c)) = a.combine(b).combine(c)
a.combine(b).apply(m) = { a.apply(m) ; b.apply(m) }
WorkSync| Modifier and Type | Method and Description |
|---|---|
void |
apply(Material material)
Apply this unit of work to the given material.
|
W |
combine(W work)
Combine this unit of work with the given unit of work, and produce a unit of work that represents the
aggregate of the work.
|
W combine(W work)
Combine this unit of work with the given unit of work, and produce a unit of work that represents the aggregate of the work.
It is perfectly fine for a unit to build up internal state that aggregates the work it is combined with, and then return itself. This is perhaps useful for reducing the allocation rate a little.
Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.