|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.labs.minion.retrieval.ArrayGroup
public class ArrayGroup
A container for the sets of arrays that are generated during document retrieval operations. This class implements a strict boolean set of documents, i.e., documents in such a set do not have any scores associated with them.
| Nested Class Summary | |
|---|---|
class |
ArrayGroup.DocIterator
A class that provides an iterator for the documents in this group. |
| Field Summary | |
|---|---|
protected int[] |
docs
The documents in the set. |
protected static java.lang.String |
logTag
|
protected DiskPartition |
part
The partition that generated this set. |
protected PassageStore[] |
pass
Passages for each field. |
protected java.util.List |
queryTerms
The query terms that generated this set. |
protected int |
size
The size of the current set, that is the number of documents that it contains. |
protected ScoreModifier |
sm
|
protected int |
width
The width of the original query, in terms. |
| Constructor Summary | |
|---|---|
protected |
ArrayGroup()
|
protected |
ArrayGroup(ArrayGroup ag)
Creates a group that shares a set of documents with another group. |
|
ArrayGroup(DiskPartition part,
int[] docs,
int l)
Creates an array group with the specified array of document IDs. |
|
ArrayGroup(int n)
Creates a group that can hold the given number of documents. |
|
ArrayGroup(int[] docs,
int l)
Creates an array group with the specified array of document IDs. |
|
ArrayGroup(PostingsIterator pi)
Creates an array group from the given postings iterator. |
| Method Summary | |
|---|---|
void |
addDoc(int docID)
Adds a document to the group. |
protected void |
addPassage(int field,
int[] newPass,
float penalty)
Adds a passage to the passages stored for the given field. |
protected void |
addPassage(int pos,
int field,
int[] newPass,
float penalty)
Adds a passage to the passages stored for the given field for the document stored at the given position. |
protected ArrayGroup |
agIntersect(ArrayGroup ag)
|
protected ArrayGroup |
agUnion(ArrayGroup ag)
Unions a statically-typed array group with the current group. |
java.lang.Object |
clone()
Clones this group. |
protected ArrayGroup |
destructiveIntersect(ArrayGroup ag)
|
ArrayGroup |
destructiveIntersect(PostingsIterator pi)
Intersects a postings iterator with this group, destructively. |
boolean |
equals(java.lang.Object o)
Tests two array groups for equality. |
int |
getDoc(int i)
Gets the docId at a particular index |
int[] |
getDocs()
Gets the documents making up this array group, as an array sized to fit. |
ArrayGroup |
getNegative()
Returns a negative version of this array group. |
DiskPartition |
getPartition()
Gets the partition that generated this group. |
java.util.Map |
getPassages(int doc)
|
ScoredGroup |
getScored()
Gets a scored version of this array group. |
int |
getSize()
Returns the size of this set. |
ArrayGroup |
getStrict()
Gets a strict version of this array group, which just returns this group. |
protected void |
init(ArrayGroup ag)
Initializes this group with data from another group. |
protected void |
init(PostingsIterator pi)
Re-initializes the group with the contents of the given postings iterator. |
ArrayGroup |
intersect(ArrayGroup ag)
Dispatches the intersect operator to the appropriate method by downcasting the Object to the proper subtype. |
ArrayGroup |
intersect(NegativeGroup ag)
|
ArrayGroup |
intersect(QueryTerm t)
Intersects the documents generated by the term with the ones in this group. |
ArrayGroup |
intersect(ScoredGroup ag)
|
ArrayGroup.DocIterator |
iterator()
Gets an iterator that will return each document in the set. |
ArrayGroup |
mult(float m)
Applies a multiplier to an array group, returning a new group. |
ArrayGroup |
normalize()
Normalizes this group. |
void |
removeDeleted()
Removes deleted documents from the results set, modifying the set in the process. |
void |
removeDeleted(ReadableBuffer del)
Removes deleted documents from the results set, modifying the set in the process. |
protected void |
resize(int n)
Resizes the group so that it can hold the given number of documents. |
void |
retain(int[] ids)
Retain only the documents with the given ids |
void |
setDoc(int i,
int docId)
Sets the docId at a particular index |
void |
setPartition(DiskPartition part)
Sets the partitoin for this group. |
protected void |
setScoreModifier(ScoreModifier sm)
|
void |
setSize(int newSize)
Sets the size of this set. |
java.lang.String |
toString()
|
ArrayGroup |
union(ArrayGroup ag)
Unions another group with this group. |
protected ArrayGroup |
union(ArrayGroup ag,
PostingsIterator pi)
Unions a postings iterator with this group, placing the results in the given group. |
ArrayGroup |
union(NegativeGroup ag)
Unions a negative group with this group, returning a negative group. |
ArrayGroup |
union(QueryTerm t)
Unions the documents generated by the term with the ones in this group. |
ArrayGroup |
union(ScoredGroup ag)
Unions a scored group with this group, returning a new scored group. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int[] docs
protected int width
pass array.
protected int size
protected PassageStore[] pass
protected DiskPartition part
protected java.util.List queryTerms
protected ScoreModifier sm
protected static java.lang.String logTag
| Constructor Detail |
|---|
protected ArrayGroup()
public ArrayGroup(int n)
n - The number of documents that the group must be able to
hold.
public ArrayGroup(int[] docs,
int l)
public ArrayGroup(DiskPartition part,
int[] docs,
int l)
public ArrayGroup(PostingsIterator pi)
protected ArrayGroup(ArrayGroup ag)
ag - The group to share data with.| Method Detail |
|---|
protected void init(ArrayGroup ag)
ag - The group to share data with.protected void init(PostingsIterator pi)
pi - The iterator to use.protected void resize(int n)
n - The number of documents that the group must be able to
hold.public ArrayGroup getNegative()
public ArrayGroup getStrict()
public ScoredGroup getScored()
public ArrayGroup normalize()
public int getSize()
public void setSize(int newSize)
newSize - the new sizepublic int[] getDocs()
public int getDoc(int i)
public void setDoc(int i,
int docId)
public void addDoc(int docID)
public ArrayGroup union(QueryTerm t)
public ArrayGroup intersect(QueryTerm t)
t - The term to intersect with the current set.
public void removeDeleted()
public void removeDeleted(ReadableBuffer del)
public void retain(int[] ids)
ids - document ids to keeppublic ArrayGroup destructiveIntersect(PostingsIterator pi)
public ArrayGroup union(ArrayGroup ag)
ag - The group to union with this group.
ag.protected ArrayGroup agUnion(ArrayGroup ag)
ArrayGroup!
public ArrayGroup union(ScoredGroup ag)
ag - The group to union with this group.
ScoredGroup that contains scores
for the documents that have them.
protected ArrayGroup union(ArrayGroup ag,
PostingsIterator pi)
ag - The group to put the results in. May need resizing.pi - The postings iterator to union.
agpublic ArrayGroup union(NegativeGroup ag)
ag - The negative group to union with this group.public ArrayGroup intersect(ArrayGroup ag)
Object to the proper subtype. The
given object must be an instance of ArrayGroup or
QueryTerm.
java.lang.ClassCastException - if the given object is not an instance of
ArrayGroup or QueryTerm.protected ArrayGroup agIntersect(ArrayGroup ag)
protected ArrayGroup destructiveIntersect(ArrayGroup ag)
public ArrayGroup intersect(ScoredGroup ag)
public ArrayGroup intersect(NegativeGroup ag)
public ArrayGroup mult(float m)
m - The multiplier to apply.
protected void setScoreModifier(ScoreModifier sm)
protected void addPassage(int field,
int[] newPass,
float penalty)
protected void addPassage(int pos,
int field,
int[] newPass,
float penalty)
public java.util.Map getPassages(int doc)
public DiskPartition getPartition()
public void setPartition(DiskPartition part)
public ArrayGroup.DocIterator iterator()
public java.lang.Object clone()
clone in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecttrue if the groups contain the same documents,
false otherwise.public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||