org.terrier.structures.indexing.singlepass.hadoop
Class IDComparator

java.lang.Object
  extended by org.terrier.structures.indexing.singlepass.hadoop.IDComparator
All Implemented Interfaces:
java.util.Comparator<java.lang.String>

public class IDComparator
extends java.lang.Object
implements java.util.Comparator<java.lang.String>

Compares String objects. It is used to sort the Map ID's for the MapData files loaded during the reduce step. It makes sure that the Map ID's are in order of the documents that they processed.

Since:
3.0
Author:
richardm

Constructor Summary
IDComparator(java.util.LinkedList<MapData> mapData)
          constructor
 
Method Summary
 int compare(java.lang.String id1, java.lang.String id2)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

IDComparator

public IDComparator(java.util.LinkedList<MapData> mapData)
constructor

Parameters:
mapData -
Method Detail

compare

public final int compare(java.lang.String id1,
                         java.lang.String id2)

Specified by:
compare in interface java.util.Comparator<java.lang.String>


Terrier 3.5. Copyright © 2004-2011 University of Glasgow