com.google.enterprise.adaptor
Class DocId

java.lang.Object
  extended by com.google.enterprise.adaptor.DocId
All Implemented Interfaces:
Comparable<DocId>

public class DocId
extends Object
implements Comparable<DocId>

Refers to a unique document in repository. It is a thin wrapper of String that adds meaning to the String and prevents the string from being confused with others that do not refer to documents.

You provide a DocId to methods like DocIdPusher.pushDocIds(java.lang.Iterable) to inform the GSA about the document's existance, so that it can crawl and index it. When the GSA requests that document's contents, Request.getDocId() will have the same unique id as DocId you provided. However, just because a DocId is provided, does not mean the value it represents exists or ever existed. The GSA can query for documents that have been deleted and users can query for documents that never existed.


Constructor Summary
DocId(String id)
          Construct an identifier based on id.
 
Method Summary
 int compareTo(DocId docId)
          Provides comparison for ids based on the unique id string.
 boolean equals(Object o)
          Determines equality based on the unique id string.
 String getUniqueId()
          Returns the string identifier provided to the constructor.
 int hashCode()
          Generates a hash code based on the unique id string.
 String toString()
          Generates a string useful for debugging that contains the unique id.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocId

public DocId(String id)
Construct an identifier based on id.

Parameters:
id - non-null document identifier
Method Detail

getUniqueId

public String getUniqueId()
Returns the string identifier provided to the constructor.


toString

public String toString()
Generates a string useful for debugging that contains the unique id.

Overrides:
toString in class Object

equals

public boolean equals(Object o)
Determines equality based on the unique id string.

Overrides:
equals in class Object

hashCode

public int hashCode()
Generates a hash code based on the unique id string.

Overrides:
hashCode in class Object

compareTo

public int compareTo(DocId docId)
Provides comparison for ids based on the unique id string.

Specified by:
compareTo in interface Comparable<DocId>