Class LinkDatum

java.lang.Object
org.apache.nutch.scoring.webgraph.LinkDatum
All Implemented Interfaces:
Writable

public class LinkDatum extends Object implements Writable
A class for holding link information including the url, anchor text, a score, the timestamp of the link and a link type.
  • Field Details

  • Constructor Details

    • LinkDatum

      public LinkDatum()
      Default constructor, no url, timestamp, score, or link type.
    • LinkDatum

      public LinkDatum(String url)
      Creates a LinkDatum with a given url. Timestamp is set to current time.
      Parameters:
      url - The link url.
    • LinkDatum

      public LinkDatum(String url, String anchor)
      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

      public LinkDatum(String url, String anchor, long timestamp)
  • Method Details

    • getUrl

      public String getUrl()
    • getAnchor

      public String getAnchor()
    • setAnchor

      public void setAnchor(String anchor)
    • getScore

      public float getScore()
    • setScore

      public void setScore(float score)
    • setUrl

      public void setUrl(String url)
    • getTimestamp

      public long getTimestamp()
    • setTimestamp

      public void setTimestamp(long timestamp)
    • getLinkType

      public byte getLinkType()
    • setLinkType

      public void setLinkType(byte linkType)
    • readFields

      public void readFields(DataInput in) throws IOException
      Specified by:
      readFields in interface Writable
      Throws:
      IOException
    • write

      public void write(DataOutput out) throws IOException
      Specified by:
      write in interface Writable
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object