|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.facet.taxonomy.directory.ParallelTaxonomyArrays
public class ParallelTaxonomyArrays
Returns 3 arrays for traversing the taxonomy:
parents
: parents[i]
denotes the parent of category
ordinal i
.children
: children[i]
denotes the youngest child of
category ordinal i
. The youngest child is defined as the category
that was added last to the taxonomy as an immediate child of i
.siblings
: siblings[i]
denotes the sibling of category
ordinal i
. The sibling is defined as the previous youngest child of
parents[i]
.children[0]
(ordinal 0 is reserved for ROOT), and then depends if you want to do DFS or
BFS, you call children[children[0]]
or siblings[children[0]]
and so forth, respectively.
NOTE: you are not expected to modify the values of the arrays, since the arrays are shared with other threads.
Constructor Summary | |
---|---|
ParallelTaxonomyArrays(IndexReader reader)
|
|
ParallelTaxonomyArrays(IndexReader reader,
ParallelTaxonomyArrays copyFrom)
|
Method Summary | |
---|---|
int[] |
children()
Returns the children array, where children[i] denotes the youngest
child of category ordinal i . |
int[] |
parents()
Returns the parents array, where parents[i] denotes the parent of
category ordinal i . |
int[] |
siblings()
Returns the siblings array, where siblings[i] denotes the sibling
of category ordinal i . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParallelTaxonomyArrays(IndexReader reader) throws IOException
IOException
public ParallelTaxonomyArrays(IndexReader reader, ParallelTaxonomyArrays copyFrom) throws IOException
IOException
Method Detail |
---|
public int[] parents()
parents[i]
denotes the parent of
category ordinal i
.
public int[] children()
children[i]
denotes the youngest
child of category ordinal i
. The youngest child is defined as the
category that was added last to the taxonomy as an immediate child of
i
.
public int[] siblings()
siblings[i]
denotes the sibling
of category ordinal i
. The sibling is defined as the previous
youngest child of parents[i]
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |