1 19 20 package com.hp.hpl.jena.ontology.impl; 23 24 25 import com.hp.hpl.jena.enhanced.*; 28 import com.hp.hpl.jena.graph.*; 29 import com.hp.hpl.jena.ontology.*; 30 31 32 41 public class MaxCardinalityQRestrictionImpl 42 extends QualifiedRestrictionImpl 43 implements MaxCardinalityQRestriction 44 { 45 48 51 56 public static Implementation factory = new Implementation() { 57 public EnhNode wrap( Node n, EnhGraph eg ) { 58 if (canWrap( n, eg )) { 59 return new MaxCardinalityQRestrictionImpl( n, eg ); 60 } 61 else { 62 throw new ConversionException( "Cannot convert node " + n + " to MaxCardinalityQRestriction"); 63 } 64 } 65 66 public boolean canWrap( Node node, EnhGraph eg ) { 67 Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null; 69 return (profile != null) && profile.isSupported( node, eg, MaxCardinalityQRestriction.class ); 70 } 71 }; 72 73 74 77 85 public MaxCardinalityQRestrictionImpl( Node n, EnhGraph g ) { 86 super( n, g ); 87 } 88 89 90 93 96 103 public void setMaxCardinalityQ( int cardinality ) { 104 setPropertyValue( getProfile().MAX_CARDINALITY_Q(), "MAX_CARDINALITY_Q", getModel().createTypedLiteral( cardinality ) ); 105 } 106 107 112 public int getMaxCardinalityQ() { 113 return objectAsInt( getProfile().MAX_CARDINALITY_Q(), "MAX_CARDINALITY_Q" ); 114 } 115 116 122 public boolean hasMaxCardinalityQ( int cardinality ) { 123 return hasPropertyValue( getProfile().MAX_CARDINALITY_Q(), "MAX_CARDINALITY_Q", getModel().createTypedLiteral( cardinality ) ); 124 } 125 126 133 public void removeMaxCardinalityQ( int cardinality ) { 134 removePropertyValue( getProfile().MAX_CARDINALITY_Q(), "MAX_CARDINALITY_Q", getModel().createTypedLiteral( cardinality ) ); 135 } 136 137 138 141 145 } 146 147 148 174 | Popular Tags |