public class AnchorTextTarget extends Object implements WritableComparable<AnchorTextTarget>, Iterable<Integer>
Constructor and Description |
---|
AnchorTextTarget()
Constructs a target with an empty source list.
|
AnchorTextTarget(AnchorTextTarget at)
Constructs a target by cloning an existing target.
|
AnchorTextTarget(int trgt,
ArrayListOfIntsWritable srcs,
float wt)
Constructs a target object from scratch.
|
Modifier and Type | Method and Description |
---|---|
void |
addSources(ArrayListOfIntsWritable sources)
Adds source documents to the list of source documents that
point to the current target document.
|
int |
compareTo(AnchorTextTarget at) |
boolean |
equals(Object o) |
ArrayListOfIntsWritable |
getSources()
Retrieves the list of source documents.
|
int |
getTarget()
Retrieves the target document id.
|
float |
getWeight() |
int |
hashCode() |
Iterator<Integer> |
iterator() |
void |
readFields(DataInput in) |
void |
setSources(ArrayListOfIntsWritable sources)
Resets the source list to the given list.
|
void |
setTarget(int target)
Sets the target document.
|
void |
setWeight(float wt)
Sets the weight for the current target document.
|
String |
toString() |
void |
write(DataOutput out) |
public AnchorTextTarget()
public AnchorTextTarget(AnchorTextTarget at)
at
- Existing target object.public AnchorTextTarget(int trgt, ArrayListOfIntsWritable srcs, float wt)
trgt
- Document id of the target document.srcs
- Source documents that point to the target document.wt
- Weight for the target document.public void addSources(ArrayListOfIntsWritable sources)
sources
- Source documents to be added.public int compareTo(AnchorTextTarget at)
compareTo
in interface Comparable<AnchorTextTarget>
public ArrayListOfIntsWritable getSources()
public int getTarget()
public float getWeight()
public void readFields(DataInput in) throws IOException
readFields
in interface Writable
IOException
public void setSources(ArrayListOfIntsWritable sources)
sources
- Source documents to be initialized with.public void setTarget(int target)
target
- New target document id.public void setWeight(float wt)
wt
- Weightpublic void write(DataOutput out) throws IOException
write
in interface Writable
IOException