|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fuberlin.wiwiss.d2rq.helpers.ConjunctionIterator
Iterates over the elements of a cross product of a set of sets.
In logical terms: given a conjunction of disjunctiveTerms
in disjunctive
normal form (a_1_1 \/ ... \/ a_1_M1) /\ .... /\ (a_n_1 \/ ... \/ a_n_Mn)
we want to multiplicate it out into conjunctive normal form
(a_1_1 /\ ... /\ a_n_1) \/ .... \/ (a_1_M1 /\ ... /\ a_n_Mn).
We can expect to get M1 * ... * Mn factors estimatedNumberOfResults
.
Field Summary | |
protected static boolean |
createTypedArrays
Flag to allow/disallow use of reflexion API. |
protected java.lang.Object[][] |
disjunctiveTerms
the disjunctions. |
protected int |
estimatedNumberOfResults
|
protected int |
n
the number of disjunctions. |
protected IndexArray |
nextIndexArray
the indices point to the terms in disjunctiveTerms that
build the next conjunction in conjunctive normal form. |
protected java.lang.Object[] |
resultStore
optionally a resultStore can be given. |
protected boolean |
resultStoreIsInitialized
|
protected java.lang.Class |
termType
Java type of a single Term a_i_j. |
Constructor Summary | |
ConjunctionIterator(java.lang.Object[][] disjunctiveTerms,
java.lang.Object[] resultStore)
|
Method Summary | |
static java.lang.Object[][] |
allConjunctions(java.lang.Object[][] disjunctiveTerms,
java.lang.Object[][] resultStore)
Get all conjunctions. |
int |
getEstimatedNumberOfResults()
|
IndexArray |
getNextIndexArray()
|
java.lang.Object[] |
getResultStore()
|
java.lang.Class |
getTermType()
|
boolean |
hasNext()
|
static boolean |
isCreateTypedArrays()
|
java.lang.Object |
next()
|
java.lang.Object[] |
nextArray()
|
void |
remove()
|
static void |
setCreateTypedArrays(boolean createTypedArrays)
|
void |
setNextIndexArray(IndexArray nextIndexArray)
|
void |
setResultStore(java.lang.Object[] resultStore)
|
void |
setTermType(java.lang.Class termType)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final int n
protected final java.lang.Object[][] disjunctiveTerms
protected static boolean createTypedArrays
true
is more convenient but may in some cases violate the
security constraints of the code.
protected java.lang.Class termType
protected IndexArray nextIndexArray
disjunctiveTerms
that
build the next conjunction in conjunctive normal form.
protected java.lang.Object[] resultStore
protected boolean resultStoreIsInitialized
protected int estimatedNumberOfResults
Constructor Detail |
public ConjunctionIterator(java.lang.Object[][] disjunctiveTerms, java.lang.Object[] resultStore)
Method Detail |
public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
public void remove() throws java.lang.UnsupportedOperationException
remove
in interface java.util.Iterator
java.lang.UnsupportedOperationException
public java.lang.Object[] nextArray()
public static boolean isCreateTypedArrays()
public static void setCreateTypedArrays(boolean createTypedArrays)
public IndexArray getNextIndexArray()
public void setNextIndexArray(IndexArray nextIndexArray)
public java.lang.Object[] getResultStore()
public void setResultStore(java.lang.Object[] resultStore)
public java.lang.Class getTermType()
public void setTermType(java.lang.Class termType)
public int getEstimatedNumberOfResults()
public static java.lang.Object[][] allConjunctions(java.lang.Object[][] disjunctiveTerms, java.lang.Object[][] resultStore)
disjunctiveTerms
- see aboveresultStore
- optional, of size [estimatedNumberOfResults][n]
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |