Class UnstableFeatureIndex
- All Implemented Interfaces:
KnowledgeIndex
A shape carrying the unstable trait with a featureId is a feature owner. A
shape belongs to an owner's feature when the owner encloses it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContainingServices(ShapeId owner) Gets the services the given feature owner resides in.getFeature(ShapeId shape) Gets the metadata of the feature the given shape belongs to.getFeatureOwners(ShapeId shape) Gets the owners of the feature the given shape belongs to.booleanisInPreviewClosure(ShapeId shape) Returns whether the given shape belongs to a feature that is in preview.static UnstableFeatureIndex
-
Constructor Details
-
UnstableFeatureIndex
-
-
Method Details
-
of
-
getFeatureOwners
Gets the owners of the feature the given shape belongs to.An owner is a shape carrying
unstablewith afeatureId, and an owner encloses itself. An empty result means the shape belongs to no feature. Exactly one owner means the shape belongs to that owner's feature. More than one owner means either the shape is shared between features or, when the shape is itself an owner, that it is nested within another feature.- Parameters:
shape- Shape to resolve.- Returns:
- Returns the enclosing owners, or an empty set if the shape belongs to no feature.
-
getContainingServices
Gets the services the given feature owner resides in.An owner that is itself a service resides in itself. This is only populated for owners, since a feature id is resolved against the
unstableFeaturestrait of the services its owner resides in. An owner nested inside another feature still reports the services it resides in.- Parameters:
owner- Feature owner to resolve.- Returns:
- Returns the services the owner resides in, or an empty set if it is bound to no service.
-
getFeature
Gets the metadata of the feature the given shape belongs to.The result is empty unless the shape belongs to exactly one feature whose id resolves to a single
unstableFeaturesentry, so an ambiguous model resolves to no feature rather than to an arbitrary one of the candidates.- Parameters:
shape- Shape to resolve.- Returns:
- Returns the feature metadata, or empty if it does not resolve.
-
isInPreviewClosure
Returns whether the given shape belongs to a feature that is in preview.- Parameters:
shape- Shape to check.- Returns:
- True if the shape is owned and all of its owners are
PREVIEWfeatures.
-