org.apache.nutch.parse
Class Outlink

java.lang.Object
  extended by org.apache.nutch.parse.Outlink
All Implemented Interfaces:
Writable

public class Outlink
extends Object
implements Writable


Constructor Summary
Outlink()
           
Outlink(String toUrl, String anchor, Configuration conf)
          An outlink with a normalized URL.
Outlink(String toUrl, String anchor, Configuration conf, boolean normalize)
          An outlink.
 
Method Summary
 boolean equals(Object o)
           
 String getAnchor()
           
 String getToUrl()
           
 int hashCode()
           
static Outlink read(DataInput in)
           
 void readFields(DataInput in)
          Reads the fields of this object from in.
static void skip(DataInput in)
          Skips over one Outlink in the input.
 String toString()
           
 void write(DataOutput out)
          Writes the fields of this object to out.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Outlink

public Outlink()

Outlink

public Outlink(String toUrl,
               String anchor,
               Configuration conf)
        throws MalformedURLException
An outlink with a normalized URL.

Parameters:
toUrl -
anchor -
conf -
Throws:
MalformedURLException

Outlink

public Outlink(String toUrl,
               String anchor,
               Configuration conf,
               boolean normalize)
        throws MalformedURLException
An outlink. Use this for unit tests and pass in normalize=false so that the normalization plugins aren't required to run.

Parameters:
toUrl -
anchor -
conf -
normalize - - if true, normalize the URL.
Throws:
MalformedURLException
Method Detail

readFields

public void readFields(DataInput in)
                throws IOException
Description copied from interface: Writable
Reads the fields of this object from in. For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Specified by:
readFields in interface Writable
Throws:
IOException

skip

public static void skip(DataInput in)
                 throws IOException
Skips over one Outlink in the input.

Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Description copied from interface: Writable
Writes the fields of this object to out.

Specified by:
write in interface Writable
Throws:
IOException

read

public static Outlink read(DataInput in)
                    throws IOException
Throws:
IOException

getToUrl

public String getToUrl()

getAnchor

public String getAnchor()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007, 2012, Oracle and/or its affiliates. All rights reserved.