gr.uoa.di.madgik.searchlibrary.operatorlibrary.sort
Class SortOp

java.lang.Object
  extended by gr.uoa.di.madgik.searchlibrary.operatorlibrary.sort.SortOp

public class SortOp
extends Object

This class performs a sorting based on some key on its input org.gcube.searchservice.searchlibrary.resultset.ResultSet and produces a output org.gcube.searchservice.searchlibrary.resultset.ResultSet sorted in the specified order.

Author:
UoA

Constructor Summary
SortOp(URI inLocator, StatsContainer stats)
          Creates a new SortOp operating on the identified input with default timeout
SortOp(URI inLocator, StatsContainer stats, long timeout, TimeUnit timeUnit)
           
 
Method Summary
 URI compute(String key, short order)
          Performs the sorting operation using default method
 URI compute(String keyFieldName, short order, ComparisonMethod comparisonMethod, ComparisonMode comparisonMode, SortAlgorithm algorithm)
          Performs the sorting operation
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortOp

public SortOp(URI inLocator,
              StatsContainer stats)
Creates a new SortOp operating on the identified input with default timeout

Parameters:
inLocator - The locator identifying the input
stats - statistics

SortOp

public SortOp(URI inLocator,
              StatsContainer stats,
              long timeout,
              TimeUnit timeUnit)
Parameters:
inLocator - The locator identifying the input with configurable timeout
stats - statistics
timeout - The timeout to be used both by the reader and the writer
timeUnit - The unit of the timeout to be used
Method Detail

compute

public URI compute(String key,
                   short order)
            throws Exception
Performs the sorting operation using default method

Parameters:
key - The key to base the sorting on
order - The order of the sorting. This can be one of CompareTokens.ASCENDING_ORDER and CompareTokens.DESCENDING_ORDER
Returns:
The locator of the produced ResultSet
Throws:
Exception - An unrecoverable for the operation error occured

compute

public URI compute(String keyFieldName,
                   short order,
                   ComparisonMethod comparisonMethod,
                   ComparisonMode comparisonMode,
                   SortAlgorithm algorithm)
            throws Exception
Performs the sorting operation

Parameters:
keyFieldName - The name of the Field which will be used as a sort key
order - The order of the sorting. This can be one of CompareTokens.ASCENDING_ORDER and CompareTokens.DESCENDING_ORDER
comparisonMethod - The method of comparison. This can be one of ComparisonMethod.PROVIDED_MODE, ComparisonMethod.DETECT_MODE and ComparisonMethod.FULL_COMPARISON
comparisonMode - The mode of comparison, provided only if comparisonMethod=ComparisonMethod.PROVIDED_MODE. This can be one of ComparisonMode.COMPARE_LONGINTS, ComparisonMode.COMPARE_DOUBLES, ComparisonMode.COMPARE_DATES and ComparisonMode.COMPARE_STRINGS
Returns:
The locator of the produced ResultSet
Throws:
Exception - An unrecoverable for the operation error occured

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2013. All Rights Reserved.