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.
 
 @FunctionalInterface public interface NeighborProviderProvides the neighbor relationships for a given shape.
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static NeighborProvidercached(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 NeighborProviderof(Model model)Creates 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 NeighborProviderreverse(Model model)Returns 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 NeighborProviderwithIdRefRelationships(Model model, NeighborProvider neighborProvider)Creates a NeighborProvider that includesRelationshipType.ID_REFrelationships.static NeighborProviderwithTraitRelationships(Model model, NeighborProvider neighborProvider)Creates a NeighborProvider that includesRelationshipType.TRAITrelationships.
 
- 
- 
- 
Method Detail- 
getNeighborsjava.util.List<Relationship> getNeighbors(Shape shape) Gets the neighbor relationships of a shape.- Parameters:
- shape- Shape to get neighbors for.
- Returns:
- Returns the found neighbors.
 
 - 
ofstatic NeighborProvider of(Model model) Creates a default NeighborProvider for the given model.- Parameters:
- model- Model to create a neighbor provider for.
- Returns:
- Returns the created neighbor provider.
 
 - 
precomputedstatic NeighborProvider precomputed(Model model) 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.
 
 - 
withTraitRelationshipsstatic NeighborProvider withTraitRelationships(Model model, NeighborProvider neighborProvider) 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.
 
 - 
withIdRefRelationshipsstatic NeighborProvider withIdRefRelationships(Model model, NeighborProvider neighborProvider) Creates a NeighborProvider that includesRelationshipType.ID_REFrelationships.- Parameters:
- model- Model to use to look up shapes referenced by- IdRefTrait.
- neighborProvider- Provider to wrap.
- Returns:
- Returns the created neighbor provider.
 
 - 
precomputedstatic NeighborProvider precomputed(Model model, NeighborProvider provider) 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.
 
 - 
reversestatic 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.- Parameters:
- model- Model to build reverse relationships from.
- Returns:
- Returns the reverse neighbor provider.
 
 - 
reversestatic 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.- Parameters:
- model- Model to build reverse relationships from.
- forwardProvider- The forward directed neighbor provider to grab relationships from.
- Returns:
- Returns the reverse neighbor provider.
 
 - 
cachedstatic NeighborProvider cached(NeighborProvider provider) Caches the results of calling a delegate provider.- Parameters:
- provider- Provider to delegate to and cache.
- Returns:
- Returns the thread-safe caching neighbor provider.
 
 
- 
 
-