@FunctionalInterface
public interface NeighborProvider
Modifier and Type | Method and Description |
---|---|
static NeighborProvider |
cached(NeighborProvider provider)
Caches the results of calling a delegate provider.
|
java.util.List<Relationship> |
getNeighbors(Shape shape)
Gets the neighbor relationships of a shape.
|
static NeighborProvider |
of(Model model)
Creates a default NeighborProvider for the given model.
|
static NeighborProvider |
precomputed(Model model)
Creates a NeighborProvider that precomputes the neighbors of a model.
|
static NeighborProvider |
precomputed(Model model,
NeighborProvider provider)
Creates a NeighborProvider that precomputes the neighbors of a model.
|
static NeighborProvider |
reverse(Model model)
Returns a NeighborProvider that returns relationships that point at a
given shape rather than relationships that the given shape points at.
|
static NeighborProvider |
reverse(Model model,
NeighborProvider forwardProvider)
Returns a NeighborProvider that returns relationships that point at a
given shape rather than relationships that the given shape points at.
|
static NeighborProvider |
withTraitRelationships(Model model,
NeighborProvider neighborProvider)
Creates a NeighborProvider that includes
RelationshipType.TRAIT
relationships. |
java.util.List<Relationship> getNeighbors(Shape shape)
shape
- Shape to get neighbors for.static NeighborProvider of(Model model)
model
- Model to create a neighbor provider for.static NeighborProvider precomputed(Model model)
model
- Model to create a neighbor provider for.static NeighborProvider withTraitRelationships(Model model, NeighborProvider neighborProvider)
RelationshipType.TRAIT
relationships.model
- Model to use to look up trait shapes.neighborProvider
- Provider to wrap.static NeighborProvider precomputed(Model model, NeighborProvider provider)
model
- Model to create a neighbor provider for.provider
- Provider to use when precomputing.static NeighborProvider reverse(Model model)
model
- Model to build reverse relationships from.static NeighborProvider reverse(Model model, NeighborProvider forwardProvider)
model
- Model to build reverse relationships from.forwardProvider
- The forward directed neighbor provider to grab relationships from.static NeighborProvider cached(NeighborProvider provider)
provider
- Provider to delegate to and cache.