public RestrictedDatatype<ATermAppl> intersect(RestrictedDatatype<?> other, boolean negated) { if( other instanceof RestrictedTextDatatype ) { RestrictedTextDatatype that = (RestrictedTextDatatype) other; return new RestrictedTextDatatype(dt, SetUtils.union(this.patterns, that.patterns), this.allowLang && that.allowLang, SetUtils.union(this.excludedValues, that.excludedValues)); } else { throw new IllegalArgumentException(); } }
public RestrictedDatatype<ATermAppl> intersect(RestrictedDatatype<?> other, boolean negated) { if( other instanceof RestrictedTextDatatype ) { RestrictedTextDatatype that = (RestrictedTextDatatype) other; return new RestrictedTextDatatype(dt, SetUtils.union(this.patterns, that.patterns), this.allowLang && that.allowLang, SetUtils.union(this.excludedValues, that.excludedValues)); } else { throw new IllegalArgumentException(); } }
/** * * @param explain * @param doExplanation * @return */ public DependencySet union(Set<ATermAppl> explain, boolean doExplanation) { if( !doExplanation || explain.isEmpty() ) return this; return new DependencySet( branch, depends.copy(), SetUtils.union( this.explain, explain ) ); }
/** * * @param explain * @param doExplanation * @return */ public DependencySet union(Set<ATermAppl> explain, boolean doExplanation) { if( !doExplanation || explain.isEmpty() ) return this; return new DependencySet( branch, depends.copy(), SetUtils.union( this.explain, explain ) ); }
/** * Create a new DependencySet and all the elements of <code>this</code> * and <code>ds</code>. * * @param ds * @param doExplanation * @return */ public DependencySet union(DependencySet ds, boolean doExplanation) { IntSet newDepends = depends.union( ds.depends ); Set<ATermAppl> newExplain; if( doExplanation ) { newExplain = SetUtils.union( explain, ds.explain ); } else { newExplain = SetUtils.emptySet(); } return new DependencySet( branch, newDepends, newExplain ); }
/** * Create a new DependencySet and all the elements of <code>this</code> * and <code>ds</code>. * * @param ds * @param doExplanation * @return */ public DependencySet union(DependencySet ds, boolean doExplanation) { IntSet newDepends = depends.union( ds.depends ); Set<ATermAppl> newExplain; if( doExplanation ) { newExplain = SetUtils.union( explain, ds.explain ); } else { newExplain = SetUtils.emptySet(); } return new DependencySet( branch, newDepends, newExplain ); }
public AtomicDatatype intersection(AtomicDatatype dt) { if(getPrimitiveType().equals(dt.getPrimitiveType()) && dt instanceof BaseAtomicDatatype) { BaseAtomicDatatype other = (BaseAtomicDatatype) dt; if(values == null) { if(negated) return this; else return other; } else if(other.values == null) { if(other.negated) return other; else return this; } else if(negated) { if(other.negated) return derive(SetUtils.union(values, other.values), true); else return derive(SetUtils.difference(other.values, values), false); } else if(other.negated) return derive(SetUtils.difference(values, other.values), false); else return derive(SetUtils.intersection(values, other.values), false); } return null; }
Set<Role> roles = SetUtils.union( r.getSubRoles(), r.getSuperRoles() ); for( Role sub: roles ) { switch ( sub.getType() ) {