Interface NeighborProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Provides the neighbor relationships for a given shape.
-
Method Summary
Modifier and TypeMethodDescriptionstatic NeighborProvider
cached
(NeighborProvider provider) Caches the results of calling a delegate provider.getNeighbors
(Shape shape) Gets the neighbor relationships of a shape.static NeighborProvider
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
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 includesRelationshipType.TRAIT
relationships.
-
Method Details
-
getNeighbors
Gets the neighbor relationships of a shape.- Parameters:
shape
- Shape to get neighbors for.- Returns:
- Returns the found neighbors.
-
of
Creates a default NeighborProvider for the given model.- Parameters:
model
- Model to create a neighbor provider for.- Returns:
- Returns the created neighbor provider.
-
precomputed
Creates a NeighborProvider that precomputes the neighbors of a model.- Parameters:
model
- Model to create a neighbor provider for.- Returns:
- Returns the created neighbor provider.
-
withTraitRelationships
Creates a NeighborProvider that includesRelationshipType.TRAIT
relationships.- Parameters:
model
- Model to use to look up trait shapes.neighborProvider
- Provider to wrap.- Returns:
- Returns the created neighbor provider.
-
precomputed
Creates a NeighborProvider that precomputes the neighbors of a model.- Parameters:
model
- Model to create a neighbor provider for.provider
- Provider to use when precomputing.- Returns:
- Returns the created neighbor provider.
-
reverse
Returns a NeighborProvider that returns relationships that point at a given shape rather than relationships that the given shape points at.- Parameters:
model
- Model to build reverse relationships from.- Returns:
- Returns the reverse neighbor provider.
-
reverse
Returns a NeighborProvider that returns relationships that point at a given shape rather than relationships that the given shape points at.- Parameters:
model
- Model to build reverse relationships from.forwardProvider
- The forward directed neighbor provider to grab relationships from.- Returns:
- Returns the reverse neighbor provider.
-
cached
Caches the results of calling a delegate provider.- Parameters:
provider
- Provider to delegate to and cache.- Returns:
- Returns the thread-safe caching neighbor provider.
-