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 NeighborProvidercached(NeighborProvider provider) Caches the results of calling a delegate provider.getNeighbors(Shape shape) Gets the neighbor relationships of a shape.static NeighborProviderCreates a default NeighborProvider for the given model.static NeighborProviderprecomputed(Model model) Creates a NeighborProvider that precomputes the neighbors of a model.static NeighborProviderprecomputed(Model model, NeighborProvider provider) Creates a NeighborProvider that precomputes the neighbors of a model.static NeighborProviderReturns a NeighborProvider that returns relationships that point at a given shape rather than relationships that the given shape points at.static NeighborProviderreverse(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 NeighborProviderwithTraitRelationships(Model model, NeighborProvider neighborProvider) Creates a NeighborProvider that includesRelationshipType.TRAITrelationships.
-
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.TRAITrelationships.- 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.
-