lempinen.neatseeker.core
Class Target

java.lang.Object
  |
  +--lempinen.neatseeker.core.Target
Direct Known Subclasses:
HTMLTarget

public abstract class Target
extends java.lang.Object

Represents a simple target document object.

The Target class provides the basic data and methods for implementing index targets. The only attributes it holds about the index target are the URI or URL and the document size.

Most search engine implementations will need more than this.

For a slightly more exciting variant, see the HTMLDocument class.


Field Summary
protected  long size
           
protected  java.lang.String uri
           
 
Constructor Summary
Target()
          Creates an empty Target instance.
Target(java.lang.String u)
          Creates an Target instance and initialises the URI.
 
Method Summary
 boolean equals(java.lang.Object anotherObject)
          Compares two Targets for equality.
 long getSize()
          Returns the size.
 java.lang.String getURI()
          Returns the URI.
private  void readObject(java.io.ObjectInputStream in)
          Reads a serialized object.
 void setSize(long s)
          Sets the size.
 void setURI(java.lang.String u)
          Sets the URI.
 java.lang.String toString()
          Returns a String representation of the Target.
private  void writeObject(java.io.ObjectOutputStream out)
          Writes the object in a serialized form.
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

uri

protected java.lang.String uri

size

protected long size
Constructor Detail

Target

public Target()
Creates an empty Target instance.

Target

public Target(java.lang.String u)
Creates an Target instance and initialises the URI.
Method Detail

setURI

public void setURI(java.lang.String u)
Sets the URI.

getURI

public java.lang.String getURI()
Returns the URI.

setSize

public void setSize(long s)
Sets the size.

getSize

public long getSize()
Returns the size.

writeObject

private void writeObject(java.io.ObjectOutputStream out)
                  throws java.io.IOException
Writes the object in a serialized form.

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Reads a serialized object.

equals

public boolean equals(java.lang.Object anotherObject)
Compares two Targets for equality. The objects are considered matching if their URIs are equal.
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Returns a String representation of the Target.
Overrides:
toString in class java.lang.Object