public class DocumentAndOp extends Object implements Writable
限定符和类型 | 类和说明 |
---|---|
static class |
DocumentAndOp.Op
This class represents the type of an operation - an insert, a delete or
an update.
|
构造器和说明 |
---|
DocumentAndOp()
Constructor for no operation.
|
DocumentAndOp(DocumentAndOp.Op op,
Document doc)
Constructor for an insert operation.
|
DocumentAndOp(DocumentAndOp.Op op,
Document doc,
Term term)
Constructor for an insert, a delete or an update operation.
|
DocumentAndOp(DocumentAndOp.Op op,
Term term)
Constructor for a delete operation.
|
限定符和类型 | 方法和说明 |
---|---|
Document |
getDocument()
Get the document.
|
DocumentAndOp.Op |
getOp()
Get the type of operation.
|
Term |
getTerm()
Get the term.
|
void |
readFields(DataInput in)
Deserialize the fields of this object from
in . |
void |
setDelete(Term term)
Set the instance to be a delete operation.
|
void |
setInsert(Document doc)
Set the instance to be an insert operation.
|
void |
setUpdate(Document doc,
Term term)
Set the instance to be an update operation.
|
String |
toString() |
void |
write(DataOutput out)
Serialize the fields of this object to
out . |
public DocumentAndOp()
public DocumentAndOp(DocumentAndOp.Op op, Document doc)
op
- doc
- public DocumentAndOp(DocumentAndOp.Op op, Term term)
op
- term
- public DocumentAndOp(DocumentAndOp.Op op, Document doc, Term term)
op
- doc
- term
- public void setInsert(Document doc)
doc
- public void setDelete(Term term)
term
- public void setUpdate(Document doc, Term term)
doc
- term
- public DocumentAndOp.Op getOp()
public Document getDocument()
public Term getTerm()
public void write(DataOutput out) throws IOException
Writable
out
.write
在接口中 Writable
out
- DataOuput
to serialize this object into.IOException
public void readFields(DataInput in) throws IOException
Writable
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
在接口中 Writable
in
- DataInput
to deseriablize this object from.IOException
Copyright © 2009 The Apache Software Foundation