Class LinkDatum
java.lang.Object
org.apache.nutch.scoring.webgraph.LinkDatum
- All Implemented Interfaces:
Writable
A class for holding link information including the url, anchor text, a score,
the timestamp of the link and a link type.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbytefloatgetScore()longgetUrl()voidreadFields(DataInput in) voidvoidsetLinkType(byte linkType) voidsetScore(float score) voidsetTimestamp(long timestamp) voidtoString()voidwrite(DataOutput out)
-
Field Details
-
INLINK
public static final byte INLINK- See Also:
-
OUTLINK
public static final byte OUTLINK- See Also:
-
-
Constructor Details
-
LinkDatum
public LinkDatum()Default constructor, no url, timestamp, score, or link type. -
LinkDatum
Creates a LinkDatum with a given url. Timestamp is set to current time.- Parameters:
url- The link url.
-
LinkDatum
Creates a LinkDatum with a url and an anchor text. Timestamp is set to current time.- Parameters:
url- The link url.anchor- The link anchor text.
-
LinkDatum
-
-
Method Details
-
getUrl
-
getAnchor
-
setAnchor
-
getScore
public float getScore() -
setScore
public void setScore(float score) -
setUrl
-
getTimestamp
public long getTimestamp() -
setTimestamp
public void setTimestamp(long timestamp) -
getLinkType
public byte getLinkType() -
setLinkType
public void setLinkType(byte linkType) -
readFields
- Specified by:
readFieldsin interfaceWritable- Throws:
IOException
-
write
- Specified by:
writein interfaceWritable- Throws:
IOException
-
toString
-