本文整理汇总了Java中org.semanticweb.owlapi.model.OWLObjectExactCardinality.getCardinality方法的典型用法代码示例。如果您正苦于以下问题:Java OWLObjectExactCardinality.getCardinality方法的具体用法?Java OWLObjectExactCardinality.getCardinality怎么用?Java OWLObjectExactCardinality.getCardinality使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLObjectExactCardinality
的用法示例。
在下文中一共展示了OWLObjectExactCardinality.getCardinality方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.semanticweb.owlapi.model.OWLObjectExactCardinality; //导入方法依赖的package包/类
@Override
public HandlerResult visit(OWLObjectExactCardinality ce) {
if (ce.getCardinality() == 0) {
// remove the ce if the max cardinality is zero
return HandlerResult.remove();
}
final OWLClassExpression filler = ce.getFiller();
final HandlerResult recursive = filler.accept(this);
OWLObjectSomeValuesFrom newCE;
if (recursive == null) {
newCE = factory.getOWLObjectSomeValuesFrom(ce.getProperty(), filler);
}
else if (recursive.remove) {
return HandlerResult.remove();
}
else {
newCE = factory.getOWLObjectSomeValuesFrom(ce.getProperty(), recursive.modified);
}
return HandlerResult.modified(newCE);
}
示例2: visit
import org.semanticweb.owlapi.model.OWLObjectExactCardinality; //导入方法依赖的package包/类
public OWLClassExpression visit(OWLObjectExactCardinality d) {
OWLClassExpression filler=getNNF(d.getFiller());
if (d.getCardinality()==0)
return m_factory.getOWLObjectMinCardinality(1,d.getProperty().getSimplified(),filler);
else {
Set<OWLClassExpression> disjuncts=new HashSet<OWLClassExpression>();
disjuncts.add(m_factory.getOWLObjectMaxCardinality(d.getCardinality()-1,d.getProperty().getSimplified(),filler));
disjuncts.add(m_factory.getOWLObjectMinCardinality(d.getCardinality()+1,d.getProperty().getSimplified(),filler));
return m_factory.getOWLObjectUnionOf(disjuncts);
}
}
示例3: visit
import org.semanticweb.owlapi.model.OWLObjectExactCardinality; //导入方法依赖的package包/类
@Override
public void visit(OWLObjectExactCardinality ce) {
hashCode = primes[42];
hashCode = hashCode * MULT + ce.getProperty().hashCode();
hashCode = hashCode * MULT + ce.getCardinality();
hashCode = hashCode * MULT + ce.getFiller().hashCode();
}
示例4: visit
import org.semanticweb.owlapi.model.OWLObjectExactCardinality; //导入方法依赖的package包/类
public Boolean visit(OWLObjectExactCardinality object) {
return object.getCardinality()>0 ? Boolean.TRUE : m_expressionManager.getComplementNNF(object.getFiller()).accept(this);
}