Class MinCardinalityRestrictionImpl

    • Field Detail

      • factory

        public static Implementation factory
        A factory for generating MinCardinalityRestriction facets from nodes in enhanced graphs. Note: should not be invoked directly by user code: use as() instead.
    • Constructor Detail

      • MinCardinalityRestrictionImpl

        public MinCardinalityRestrictionImpl​(Node n,
                                             EnhGraph g)

        Construct a min cardinality restriction node represented by the given node in the given graph.

        Parameters:
        n - The node that represents the resource
        g - The enh graph that contains n
    • Method Detail

      • setMinCardinality

        public void setMinCardinality​(int cardinality)

        Assert that this restriction restricts the property to have the given minimum cardinality. Any existing statements for minCardinality will be removed.

        Specified by:
        setMinCardinality in interface MinCardinalityRestriction
        Parameters:
        cardinality - The minimum cardinality of the restricted property
        Throws:
        ProfileException - If the Profile.MIN_CARDINALITY() property is not supported in the current language profile.
      • hasMinCardinality

        public boolean hasMinCardinality​(int cardinality)

        Answer true if this property restriction has the given minimum cardinality.

        Specified by:
        hasMinCardinality in interface MinCardinalityRestriction
        Parameters:
        cardinality - The cardinality to test against
        Returns:
        True if the given cardinality is the min cardinality of the restricted property in this restriction
        Throws:
        ProfileException - If the Profile.MIN_CARDINALITY() property is not supported in the current language profile.
      • removeMinCardinality

        public void removeMinCardinality​(int cardinality)

        Remove the statement that this restriction has the given minimum cardinality for the restricted property. If this statement is not true of the current model, nothing happens.

        Specified by:
        removeMinCardinality in interface MinCardinalityRestriction
        Parameters:
        cardinality - A min cardinality value to be removed from this restriction