- java.lang.Object
-
- org.logicng.datastructures.ubtrees.UBTree<T>
-
- Type Parameters:
T- the type of the elements (must be comparable)
public final class UBTree<T extends Comparable<T>> extends Object
A data structure for storing sets with efficient sub- and superset queries. C.f. `A New Method to Index and Query Sets`, Hoffmann and Koehler, 1999- Since:
- 1.5.0
- Version:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description UBTree()Constructs an empty UBTree.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSet(SortedSet<T> set)Adds a set of comparable objects to this UBTree.Set<SortedSet<T>>allSets()Returns all sets in this UBTree.Set<SortedSet<T>>allSubsets(SortedSet<T> set)Returns all subsets of a given set in this UBTree.Set<SortedSet<T>>allSupersets(SortedSet<T> set)Returns all supersets of a given set in this UBTree.SortedSet<T>firstSubset(SortedSet<T> set)Returns the first subset of a given set in this UBTree.
-
-
-
Method Detail
-
addSet
public void addSet(SortedSet<T> set)
Adds a set of comparable objects to this UBTree.- Parameters:
set- the set of comparable objects
-
firstSubset
public SortedSet<T> firstSubset(SortedSet<T> set)
Returns the first subset of a given set in this UBTree.- Parameters:
set- the set to search for- Returns:
- the first subset which is found for the given set or
nullif there is none
-
allSubsets
public Set<SortedSet<T>> allSubsets(SortedSet<T> set)
Returns all subsets of a given set in this UBTree.- Parameters:
set- the set to search for- Returns:
- all subsets of the given set
-
allSupersets
public Set<SortedSet<T>> allSupersets(SortedSet<T> set)
Returns all supersets of a given set in this UBTree.- Parameters:
set- the set to search for- Returns:
- all supersets of the given set
-
-