org.deri.iris.rules.compiler
Class Utils

java.lang.Object
  extended by org.deri.iris.rules.compiler.Utils

public class Utils
extends Object

Utilities for classes in this package.


Constructor Summary
Utils()
           
 
Method Summary
static List<ITuple> createAllCombinations(ITuple tuple, IEquivalentTerms equivalentTerms)
          Creates all possible combinations of the terms of a specified tuple with their equivalent terms.
static int[] integerListToArray(List<Integer> list)
          Convert a list of integers to an array.
static List<ITerm> makeKey(ITuple tuple, int[] indices)
          Make a list of terms by selecting them from a tuple.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

integerListToArray

public static int[] integerListToArray(List<Integer> list)
Convert a list of integers to an array.

Parameters:
list - The list of integers.
Returns:
An array of integers.

makeKey

public static List<ITerm> makeKey(ITuple tuple,
                                  int[] indices)
Make a list of terms by selecting them from a tuple.

Parameters:
tuple - The tuple containing terms to select.
indices - The indices of terms to use.
Returns:
The list of selected tuples.

createAllCombinations

public static List<ITuple> createAllCombinations(ITuple tuple,
                                                 IEquivalentTerms equivalentTerms)
Creates all possible combinations of the terms of a specified tuple with their equivalent terms.

Parameters:
tuple - The tuple for which all possible combinations should be created.
equivalentTerms - The equivalent terms.
Returns:
All possible combinations of the terms of the specified tuple with their equivalent terms.