/** * <p>Answer true if this property restriction has the given cardinality.</p> * @param cardinality The cardinality to test against * @return True if the given cardinality is the cardinality of the restricted property in this restriction * @exception ProfileException If the {@link Profile#CARDINALITY()} property is not supported in the current language profile. */ @Override public boolean hasCardinality( int cardinality ) { return hasPropertyValue( getProfile().CARDINALITY(), "CARDINALITY", getModel().createTypedLiteral( cardinality ) ); }
/** * <p>Answer the cardinality of the restricted property.</p> * @return The cardinality of the restricted property * @exception ProfileException If the {@link Profile#CARDINALITY()} property is not supported in the current language profile. */ @Override public int getCardinality() { return objectAsInt( getProfile().CARDINALITY(), "CARDINALITY" ); }
/** * <p>Remove the statement that this restriction has the given cardinality * for the restricted property. If this statement * is not true of the current model, nothing happens.</p> * @param cardinality A cardinality value to be removed from this restriction */ @Override public void removeCardinality( int cardinality ) { removePropertyValue( getProfile().CARDINALITY(), "CARDINALITY", getModel().createTypedLiteral( cardinality ) ); }
/** * <p>Assert that this restriction restricts the property to have the given * cardinality. Any existing statements for <code>cardinality</code> * will be removed.</p> * @param cardinality The cardinality of the restricted property * @exception ProfileException If the {@link Profile#CARDINALITY()} property is not supported in the current language profile. */ @Override public void setCardinality( int cardinality ) { setPropertyValue( getProfile().CARDINALITY(), "CARDINALITY", getModel().createTypedLiteral( cardinality ) ); }
@Override public EnhNode wrap( Node n, EnhGraph eg ) { if (canWrap( n, eg )) { return new CardinalityRestrictionImpl( n, eg ); } else { throw new ConversionException( "Cannot convert node " + n + " to CardinalityRestriction"); } }
/** * <p>Assert that this restriction restricts the property to have the given * cardinality. Any existing statements for <code>cardinality</code> * will be removed.</p> * @param cardinality The cardinality of the restricted property * @exception ProfileException If the {@link Profile#CARDINALITY()} property is not supported in the current language profile. */ @Override public void setCardinality( int cardinality ) { setPropertyValue( getProfile().CARDINALITY(), "CARDINALITY", getModel().createTypedLiteral( cardinality ) ); }
@Override public EnhNode wrap( Node n, EnhGraph eg ) { if (canWrap( n, eg )) { return new CardinalityRestrictionImpl( n, eg ); } else { throw new ConversionException( "Cannot convert node " + n + " to CardinalityRestriction"); } }
/** * <p>Answer true if this property restriction has the given cardinality.</p> * @param cardinality The cardinality to test against * @return True if the given cardinality is the cardinality of the restricted property in this restriction * @exception ProfileException If the {@link Profile#CARDINALITY()} property is not supported in the current language profile. */ @Override public boolean hasCardinality( int cardinality ) { return hasPropertyValue( getProfile().CARDINALITY(), "CARDINALITY", getModel().createTypedLiteral( cardinality ) ); }
/** * <p>Remove the statement that this restriction has the given cardinality * for the restricted property. If this statement * is not true of the current model, nothing happens.</p> * @param cardinality A cardinality value to be removed from this restriction */ @Override public void removeCardinality( int cardinality ) { removePropertyValue( getProfile().CARDINALITY(), "CARDINALITY", getModel().createTypedLiteral( cardinality ) ); }
/** * <p>Answer the cardinality of the restricted property.</p> * @return The cardinality of the restricted property * @exception ProfileException If the {@link Profile#CARDINALITY()} property is not supported in the current language profile. */ @Override public int getCardinality() { return objectAsInt( getProfile().CARDINALITY(), "CARDINALITY" ); }