Class AtomSetUtils
java.lang.Object
fr.lirmm.graphik.integraal.core.atomset.AtomSetUtils
Utility methods for common atom-set predicates and transformations.
- Author:
- Clément Sipieter (INRIA) <clement@6pi.fr>
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontains(InMemoryAtomSet a1, InMemoryAtomSet a2) Returns whether the first atom set contains all atoms from the second one.static booleanReturns whether the specified atom set contains exactly two atoms.static booleanReturns whether the specified in-memory atom set contains exactly two atoms.static booleanReturns whether the specified atom set contains exactly one atom.static booleanReturns whether the specified in-memory atom set contains exactly one atom.static InMemoryAtomSetminus(InMemoryAtomSet a1, InMemoryAtomSet a2) Computes the set differencea1 \ a2.static LinkedList<Term> sep(InMemoryAtomSet a1, InMemoryAtomSet a2) Returns the separator terms occurring both inQ \\ PandP.static InMemoryAtomSetunion(InMemoryAtomSet a1, InMemoryAtomSet a2) Computes the union of two in-memory atom sets.
-
Method Details
-
isSingleton
Returns whether the specified atom set contains exactly one atom.- Parameters:
a- the atom set to inspect- Returns:
- true if the atom set is a singleton
- Throws:
IteratorException- if the atom set iterator fails
-
isSingleton
Returns whether the specified in-memory atom set contains exactly one atom.- Parameters:
a- the atom set to inspect- Returns:
- true if the atom set is a singleton
-
hasSize2
Returns whether the specified atom set contains exactly two atoms.- Parameters:
a- the atom set to inspect- Returns:
- true if the atom set contains exactly two atoms
- Throws:
IteratorException- if the atom set iterator fails
-
hasSize2
Returns whether the specified in-memory atom set contains exactly two atoms.- Parameters:
a- the atom set to inspect- Returns:
- true if the atom set contains exactly two atoms
-
contains
Returns whether the first atom set contains all atoms from the second one.- Parameters:
a1- the candidate superseta2- the candidate subset- Returns:
- true if a1 contains a2, false otherwise.
-
minus
Computes the set differencea1 \ a2.- Parameters:
a1- the source atom seta2- the atoms to remove- Returns:
- the atoms of
a1that are not ina2
-
sep
Returns the separator terms occurring both inQ \\ PandP.- Parameters:
a1- the first atom seta2- the second atom set- Returns:
- the separator terms
-
union
Computes the union of two in-memory atom sets.- Parameters:
a1- the first atom seta2- the second atom set- Returns:
- the union of both atom sets
-