org.apache.nutch.scoring.webgraph

## Class LinkDatum

- java.lang.Object
- - org.apache.nutch.scoring.webgraph.LinkDatum

- All Implemented Interfaces:
    Writable

      public class LinkDatum
      extends java.lang.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 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(java.lang.String url)` Creates a LinkDatum with a given url.
    `LinkDatum(java.lang.String url, java.lang.String anchor)` Creates a LinkDatum with a url and an anchor text.
    `LinkDatum(java.lang.String url, java.lang.String anchor, long timestamp)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getAnchor()`
    `byte` | `getLinkType()`
    `float` | `getScore()`
    `long` | `getTimestamp()`
    `java.lang.String` | `getUrl()`
    `void` | `readFields(java.io.DataInput in)`
    `void` | `setAnchor(java.lang.String anchor)`
    `void` | `setLinkType(byte linkType)`
    `void` | `setScore(float score)`
    `void` | `setTimestamp(long timestamp)`
    `void` | `setUrl(java.lang.String url)`
    `java.lang.String` | `toString()`
    `void` | `write(java.io.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

    - #### OUTLINK

          public static final byte OUTLINK

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### LinkDatum

          public LinkDatum()

      Default constructor, no url, timestamp, score, or link type.

    - #### LinkDatum

          public LinkDatum(java.lang.String url)

      Creates a LinkDatum with a given url. Timestamp is set to current time.
      Parameters:
        `url` - The link url.

    - #### LinkDatum

          public LinkDatum(java.lang.String url,
                           java.lang.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(java.lang.String url,
                           java.lang.String anchor,
                           long timestamp)

  - ### Method Detail

    - #### getUrl

          public java.lang.String getUrl()

    - #### getAnchor

          public java.lang.String getAnchor()

    - #### setAnchor

          public void setAnchor(java.lang.String anchor)

    - #### getScore

          public float getScore()

    - #### setScore

          public void setScore(float score)

    - #### setUrl

          public void setUrl(java.lang.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(java.io.DataInput in)
                          throws java.io.IOException

      Specified by:
        `readFields` in interface `Writable`
      Throws:
        `java.io.IOException`

    - #### write

          public void write(java.io.DataOutput out)
                     throws java.io.IOException

      Specified by:
        `write` in interface `Writable`
      Throws:
        `java.io.IOException`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2019 The Apache Software Foundation