[TOC]

org.apache.nutch.scoring.webgraph

Class LinkDatum

    • All Implemented Interfaces:
    • org.apache.hadoop.io.Writable

public class LinkDatum
extends Object
implements org.apache.hadoop.io.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 Modifier and Type Field and Description static byte INLINK static byte OUTLINK

Constructor Summary

Constructors Constructor and Description LinkDatum() Default constructor, no url, timestamp, score, or link type. LinkDatum(String url) Creates a LinkDatum with a given url. LinkDatum(String url, String anchor) Creates a LinkDatum with a url and an anchor text. LinkDatum(String url, String anchor, long timestamp)

Method Summary

Methods Modifier and Type Method and Description String getAnchor() byte getLinkType() float getScore() long getTimestamp() String getUrl() void readFields(DataInput in) void setAnchor(String anchor) void setLinkType(byte linkType) void setScore(float score) void setTimestamp(long timestamp) void setUrl(String url) String toString() void write(DataOutput out)

-    

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

-  

INLINK

public static final byte INLINK
  - See Also:
  - [Constant Field Values](../../../../../constant-values.html#org.apache.nutch.scoring.webgraph.LinkDatum.INLINK)       
-  

OUTLINK

public static final byte OUTLINK
  - See Also:
  - [Constant Field Values](../../../../../constant-values.html#org.apache.nutch.scoring.webgraph.LinkDatum.OUTLINK)       

Constructor Detail

-  

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:
  - <code>url</code> - 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:
  - <code>url</code> - The link url.
  - <code>anchor</code> - The link anchor text.       
-  

LinkDatum

public LinkDatum(String url,
         String anchor,
         long timestamp)

Method Detail

-  

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: 
  - <code>readFields</code> in interface <code>org.apache.hadoop.io.Writable</code> 
  - Throws: 
  - <code>IOException</code>       
-  

write

public void write(DataOutput out)
           throws IOException
  - Specified by: 
  - <code>write</code> in interface <code>org.apache.hadoop.io.Writable</code> 
  - Throws: 
  - <code>IOException</code>       
-  

toString

public String toString()
  - Overrides: 
  - <code>toString</code> in class <code>Object</code>       

Copyright © 2014 The Apache Software Foundation