@Nonnull protected static <T extends OWLObject> List<T> sort( @Nonnull Collection<T> objects) { return CollectionFactory.sortOptionally(objects); }
protected void render(Set<? extends OWLObject> objects) { for (Iterator<? extends OWLObject> it = CollectionFactory.sortOptionally(objects).iterator(); it.hasNext();) { it.next().accept(this); if (it.hasNext()) { sb.append(' '); } } }
/** * @param operands * operands */ public OWLNaryBooleanClassExpressionImpl( @Nonnull Set<? extends OWLClassExpression> operands) { checkNotNull(operands, "operands cannot be null"); this.operands = CollectionFactory.sortOptionally((Set<OWLClassExpression>) operands); }
protected OWLNaryDataRangeImpl(@Nonnull Set<? extends OWLDataRange> operands) { checkNotNull(operands, "operands cannot be null"); this.operands = CollectionFactory.sortOptionally((Set<OWLDataRange>) operands); }
/** * @param values * lierals */ public OWLDataOneOfImpl(@Nonnull Set<? extends OWLLiteral> values) { checkNotNull(values, "values cannot be null"); this.values = CollectionFactory.sortOptionally((Set<OWLLiteral>) values); }
/** * @param individuals * individuals * @param annotations * annotations on the axiom */ @SuppressWarnings("unchecked") public OWLNaryIndividualAxiomImpl( @Nonnull Set<? extends OWLIndividual> individuals, @Nonnull Collection<? extends OWLAnnotation> annotations) { super(annotations); checkNotNull(individuals, "individuals cannot be null"); this.individuals = (List<OWLIndividual>) sortOptionally(individuals); }
/** * @param properties * properties * @param annotations * annotations */ @SuppressWarnings("unchecked") public OWLNaryPropertyAxiomImpl(@Nonnull Set<? extends P> properties, @Nonnull Collection<? extends OWLAnnotation> annotations) { super(annotations); checkNotNull(properties, "properties cannot be null"); this.properties = (List<P>) CollectionFactory .sortOptionally(properties); }
/** * @param classExpressions * classes * @param annotations * annotations */ @SuppressWarnings("unchecked") public OWLNaryClassAxiomImpl( @Nonnull Set<? extends OWLClassExpression> classExpressions, @Nonnull Collection<? extends OWLAnnotation> annotations) { super(annotations); checkNotNull(classExpressions, "classExpressions cannot be null"); this.classExpressions = (List<OWLClassExpression>) sortOptionally(classExpressions); }
/** * @param datatype * datatype * @param facetRestrictions * facet restriction */ public OWLDatatypeRestrictionImpl(@Nonnull OWLDatatype datatype, @Nonnull Set<OWLFacetRestriction> facetRestrictions) { this.datatype = checkNotNull(datatype, "datatype cannot be null"); checkNotNull(facetRestrictions, "facetRestrictions cannot be null"); this.facetRestrictions = CollectionFactory.sortOptionally(facetRestrictions); }
/** * @param annotations * annotations on the axiom */ @SuppressWarnings("unchecked") public OWLAxiomImplWithoutEntityAndAnonCaching(@Nonnull Collection<? extends OWLAnnotation> annotations) { checkNotNull(annotations, "annotations cannot be null"); if (!annotations.isEmpty()) { if (annotations.size() == 1) { OWLAnnotation tmp = annotations.iterator().next(); this.annotations = Collections.singletonList(tmp); } else { this.annotations = (List<OWLAnnotation>) sortOptionally(annotations); } } else { this.annotations = emptyList(); } }
/** * @param annotations * annotations on the axiom */ @SuppressWarnings("unchecked") public OWLAxiomImplWithEntityAndAnonCaching(@Nonnull Collection<? extends OWLAnnotation> annotations) { checkNotNull(annotations, "annotations cannot be null"); if (!annotations.isEmpty()) { if (annotations.size() == 1) { OWLAnnotation tmp = annotations.iterator().next(); this.annotations = Collections.singletonList(tmp); } else { this.annotations = (List<OWLAnnotation>) sortOptionally(annotations); } } else { this.annotations = emptyList(); } }
/** * @param owlClass * union * @param classExpressions * disjoint classes * @param annotations * annotations */ public OWLDisjointUnionAxiomImpl(@Nonnull OWLClass owlClass, @Nonnull Set<? extends OWLClassExpression> classExpressions, @Nonnull Set<? extends OWLAnnotation> annotations) { super(annotations); this.owlClass = checkNotNull(owlClass, "owlClass cannot be null"); checkNotNull(classExpressions, "classExpressions cannot be null"); this.classExpressions = CollectionFactory.sortOptionally((Set<OWLClassExpression>) classExpressions); }
/** * @param expression * class expression * @param propertyExpressions * properties * @param annotations * annotations on the axiom */ public OWLHasKeyAxiomImpl(@Nonnull OWLClassExpression expression, @Nonnull Set<? extends OWLPropertyExpression> propertyExpressions, @Nonnull Collection<? extends OWLAnnotation> annotations) { super(annotations); this.expression = checkNotNull(expression, "expression cannot be null"); checkNotNull( propertyExpressions, "propertyExpressions cannot be null"); this.propertyExpressions = CollectionFactory.sortOptionally((Set<OWLPropertyExpression>) propertyExpressions); }
/** * @param property * annotation property * @param value * annotation value * @param annotations * annotations on the axiom */ public OWLAnnotationImpl(@Nonnull OWLAnnotationProperty property, @Nonnull OWLAnnotationValue value, @Nonnull Set<? extends OWLAnnotation> annotations) { this.property = checkNotNull(property, "property cannot be null"); this.value = checkNotNull(value, "value cannot be null"); checkNotNull(annotations, "annotations cannot be null"); anns = CollectionFactory.sortOptionally((Set<OWLAnnotation>) annotations); }
@Override public void visit(@Nonnull OWLObjectUnionOf ce) { boolean first = true; for (OWLClassExpression op : sortOptionally(ce.getOperands())) { if (!first) { write(" ", OR, " "); } first = false; if (op.isAnonymous()) { write("("); } op.accept(this); if (op.isAnonymous()) { write(")"); } } }