@Deprecated public static <T> Set<T> makeSet(final int size) { return SetUtils.create(size); }
@Override public Set<Role> getProperSubRoles() { return SetUtils.difference(_subRoles, _superRoles); }
private static boolean checkDisjointProperties(final Set<Role> roles1, final Set<Role> roles2) { final Set<Role> allDisjoints = new HashSet<>(); for (final Role role : roles1) allDisjoints.addAll(role.getDisjointRoles()); return SetUtils.intersects(allDisjoints, roles2); }
/** * @param r The functionalSuper to set. */ @Override public void addFunctionalSuper(final Role r) { for (final Role fs : _functionalSupers) if (fs.isSubRoleOf(r)) { _functionalSupers = SetUtils.remove(fs, _functionalSupers); break; } else if (r.isSubRoleOf(fs)) return; _functionalSupers = SetUtils.add(r, _functionalSupers); }
@Override public RestrictedDatatype<ATermAppl> intersect(final RestrictedDatatype<?> other, final boolean negated) { if (other instanceof RestrictedTextDatatype) { final RestrictedTextDatatype that = (RestrictedTextDatatype) other; return new RestrictedTextDatatype(_dt, // _check.and(that._check), // _allowLang && that._allowLang, // SetUtils.union(_excludedValues, that._excludedValues)); } else throw new IllegalArgumentException(); }
@Override public Set<Role> getEquivalentProperties() { return SetUtils.intersection(_subRoles, _superRoles); }
@Override public void addSuperRole(final Role r, final DependencySet ds) { _superRoles = SetUtils.add(r, _superRoles); _explainSup.put(r.getName(), ds); }
@Override public void removeSubRole(final Role r) { _subRoles = SetUtils.remove(r, _subRoles); }
/** * Adds the given object to the set but saves memory space by allocating only the required amount for small sets. The idea is to use the specialized empty * set and singleton set implementations (which are immutable) for the sets of size 0 and 1. If the set is empty a new singleton set is created, if set has * one element we create a new set with two elements, otherwise we simply add the element to the given set.This technique is most useful if the expected set * size is 0 or 1. * * @param o * @param set * @return merge of set */ public static <T> Set<T> add(final T o, final Set<T> set) { switch (set.size()) { case 0: return Collections.singleton(o); case 1: { final T existing = set.iterator().next(); if (existing.equals(o)) return set; return binary(existing, o); } default: { set.add(o); return set; } } }
@Override public RestrictedDatatype<ATermAppl> intersect(final RestrictedDatatype<?> other, final boolean negated) { if (other instanceof RestrictedTextDatatype) { final RestrictedTextDatatype that = (RestrictedTextDatatype) other; return new RestrictedTextDatatype(_dt, // _check.and(that._check), // _allowLang && that._allowLang, // SetUtils.union(_excludedValues, that._excludedValues)); } else throw new IllegalArgumentException(); }
/** * @param r The functionalSuper to set. */ @Override public void addFunctionalSuper(final Role r) { for (final Role fs : _functionalSupers) if (fs.isSubRoleOf(r)) { _functionalSupers = SetUtils.remove(fs, _functionalSupers); break; } else if (r.isSubRoleOf(fs)) return; _functionalSupers = SetUtils.add(r, _functionalSupers); }
@Override public Set<Role> getEquivalentProperties() { return SetUtils.intersection(_subRoles, _superRoles); }
@Override public void addSuperRole(final Role r, final DependencySet ds) { _superRoles = SetUtils.add(r, _superRoles); _explainSup.put(r.getName(), ds); }
@Override public void removeSubRole(final Role r) { _subRoles = SetUtils.remove(r, _subRoles); }
/** * Adds the given object to the set but saves memory space by allocating only the required amount for small sets. The idea is to use the specialized empty * set and singleton set implementations (which are immutable) for the sets of size 0 and 1. If the set is empty a new singleton set is created, if set has * one element we create a new set with two elements, otherwise we simply add the element to the given set.This technique is most useful if the expected set * size is 0 or 1. * * @param o * @param set * @return merge of set */ public static <T> Set<T> add(final T o, final Set<T> set) { switch (set.size()) { case 0: return Collections.singleton(o); case 1: { final T existing = set.iterator().next(); if (existing.equals(o)) return set; return binary(existing, o); } default: { set.add(o); return set; } } }
@Deprecated public static <T> Set<T> makeSet(final Collection<? extends T> a) { return SetUtils.create(a); } }
private static boolean checkDisjointProperties(final Set<Role> roles1, final Set<Role> roles2) { final Set<Role> allDisjoints = new HashSet<>(); for (final Role role : roles1) allDisjoints.addAll(role.getDisjointRoles()); return SetUtils.intersects(allDisjoints, roles2); }
@Override public Set<Role> getProperSubRoles() { return SetUtils.difference(_subRoles, _superRoles); }
/** * @param explain * @param doExplanation * @return the union as dependencySet */ public DependencySet union(final Set<ATermAppl> explain, final boolean doExplanation) { if (!doExplanation || explain.isEmpty()) return this; return new DependencySet(_branch, _depends.copy(), SetUtils.union(_explain, explain)); }
for (final BetaNode existingBeta : SetUtils.intersection(alpha.getBetas(), node.getBetas())) if (existingBeta instanceof BetaMemoryNode && conditions.equals(((BetaMemoryNode) existingBeta).getConditions()))