org.apache.uima.cas.impl
Class LinearTypeOrderBuilderImpl

java.lang.Object
  extended by org.apache.uima.cas.impl.LinearTypeOrderBuilderImpl
All Implemented Interfaces:
LinearTypeOrderBuilder

public class LinearTypeOrderBuilderImpl
extends java.lang.Object
implements LinearTypeOrderBuilder

Implementation of the LinearTypeOrderBuilder interface.


Constructor Summary
LinearTypeOrderBuilderImpl(TypeSystem ts)
           
 
Method Summary
 void add(java.lang.String[] types)
          Add pairs types[i] < types[i+1], for each i < (types.length-1), to the partial sort order.
static LinearTypeOrder createTypeOrder(int[] typeList, TypeSystem ts)
           
 LinearTypeOrder getOrder()
          Return a total order of the type names added earlier that is consistent with the pre-order defined through calls to add().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearTypeOrderBuilderImpl

public LinearTypeOrderBuilderImpl(TypeSystem ts)
Method Detail

createTypeOrder

public static LinearTypeOrder createTypeOrder(int[] typeList,
                                              TypeSystem ts)

add

public void add(java.lang.String[] types)
         throws CASException
Description copied from interface: LinearTypeOrderBuilder
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.

Specified by:
add in interface LinearTypeOrderBuilder
Throws:
CASException - When adding pairs would make order inconsistent.

getOrder

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

Specified by:
getOrder in interface LinearTypeOrderBuilder
Returns:
An array of Strings in ascending order.
Throws:
CASException


Copyright © 2011. All Rights Reserved.