org.apache.uima.cas.admin
Interface LinearTypeOrderBuilder


public interface LinearTypeOrderBuilder

Defines a pre-order on types. This pre-order is later embedded in a total order an can be used in index comparators.


Method Summary
 void add(String[] types)
          Add pairs types[i] < types[i+1], for each i < (types.length-1), to the partial sort order.
 LinearTypeOrder getOrder()
          Return a total order of the type names added earlier that is consistent with the pre-order defined through calls to add().
 

Method Detail

add

void add(String[] types)
         throws CASException
Add pairs types[i] < types[i+1], for each i < (types.length-1), to the partial sort order. This method can be called as often as desired. It will throw an exception if the pairs could not be successfully added to the relation. A pair can not be added if the resulting relation is no longer a partial order. If you need to know exactly which pair fails, always call add() with a two-element array.

Parameters:
types -
Throws:
CASException - When adding pairs would make order inconsistent.

getOrder

LinearTypeOrder getOrder()
                         throws CASException
Return a total order of the type names added earlier that is consistent with the pre-order defined through calls to add().

Returns:
An array of Strings in ascending order.
Throws:
CASException


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.