Class MaxCardinalityRestrictionImpl

    • Field Detail

      • factory

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

      • MaxCardinalityRestrictionImpl

        public MaxCardinalityRestrictionImpl​(Node n,
                                             EnhGraph g)

        Construct a max 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

      • setMaxCardinality

        public void setMaxCardinality​(int cardinality)

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

        Specified by:
        setMaxCardinality in interface MaxCardinalityRestriction
        Parameters:
        cardinality - The maximum cardinality of the restricted property
        Throws:
        ProfileException - If the Profile.MAX_CARDINALITY() property is not supported in the current language profile.
      • hasMaxCardinality

        public boolean hasMaxCardinality​(int cardinality)

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

        Specified by:
        hasMaxCardinality in interface MaxCardinalityRestriction
        Parameters:
        cardinality - The cardinality to test against
        Returns:
        True if the given cardinality is the max cardinality of the restricted property in this restriction
        Throws:
        ProfileException - If the Profile.MAX_CARDINALITY() property is not supported in the current language profile.
      • removeMaxCardinality

        public void removeMaxCardinality​(int cardinality)

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

        Specified by:
        removeMaxCardinality in interface MaxCardinalityRestriction
        Parameters:
        cardinality - A max cardinality value to be removed from this restriction