org.deri.iris
Class VariableExtractor

java.lang.Object
  extended by org.deri.iris.VariableExtractor

public class VariableExtractor
extends Object

Helpermethods to extract variables from terms, tuples and literals.

$Id: VariableExtractor.java,v 1.1 2007-10-30 09:29:25 poettler_ric Exp $

Version:
$Revision: 1.1 $
Author:
Richard P??ttler (richard dot poettler at deri dot at)

Method Summary
static Set<IVariable> getLiteralVariables(Collection<? extends ILiteral> l)
          Retrieves the variables out of a collection of literals.
static Collection<IVariable> getLiteralVariables(Collection<? extends ILiteral> from, Collection<IVariable> to)
          Retrieves the variables out of a collection of literals.
static List<IVariable> getLiteralVariablesList(Collection<? extends ILiteral> l)
          Retrieves the variables out of a collection of literals.
static Set<IVariable> getTermVariables(Collection<? extends ITerm> t)
          Retrieves the variables out of a collection of terms.
static Collection<IVariable> getTermVariables(Collection<? extends ITerm> from, Collection<IVariable> to)
          Retrieves the variables out of a collection of terms.
static List<IVariable> getTermVariablesList(Collection<? extends ITerm> t)
          Retrieves the variables out of a collection of terms.
static Set<IVariable> getTupleVariables(Collection<? extends ITuple> t)
          Retrieves the variables out of a collection of tuples.
static Collection<IVariable> getTupleVariables(Collection<? extends ITuple> from, Collection<IVariable> to)
          Retrieves the variables out of a collection of tuples.
static List<IVariable> getTupleVariablesList(Collection<? extends ITuple> t)
          Retrieves the variables out of a collection of tuples.
static Set<IVariable> getVariables(ILiteral... l)
          Retrieves the variables out of a array of literals.
static Set<IVariable> getVariables(ITerm... t)
          Retrieves the variables out of a array of terms.
static Set<IVariable> getVariables(ITuple... t)
          Retrieves the variables out of a array of tuples.
static List<IVariable> getVariablesList(ILiteral... l)
          Retrieves the variables out of a array of literals.
static List<IVariable> getVariablesList(ITerm... t)
          Retrieves the variables out of a array of terms.
static List<IVariable> getVariablesList(ITuple... t)
          Retrieves the variables out of a array of tuples.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTermVariables

public static Collection<IVariable> getTermVariables(Collection<? extends ITerm> from,
                                                     Collection<IVariable> to)
Retrieves the variables out of a collection of terms.

Parameters:
from - the terms
to - the collection where to add the variables to
Returns:
the reference to to
Throws:
IllegalArgumentException - if t is null
IllegalArgumentException - if to is null

getTupleVariables

public static Collection<IVariable> getTupleVariables(Collection<? extends ITuple> from,
                                                      Collection<IVariable> to)
Retrieves the variables out of a collection of tuples.

Parameters:
from - the tuples
to - the collection where to add the variables to
Returns:
the reference to to
Throws:
IllegalArgumentException - if t is null
IllegalArgumentException - if to is null

getLiteralVariables

public static Collection<IVariable> getLiteralVariables(Collection<? extends ILiteral> from,
                                                        Collection<IVariable> to)
Retrieves the variables out of a collection of literals.

Parameters:
from - the literals
to - the collection where to add the variables to
Returns:
the reference to to
Throws:
IllegalArgumentException - if t is null
IllegalArgumentException - if to is null

getTermVariablesList

public static List<IVariable> getTermVariablesList(Collection<? extends ITerm> t)
Retrieves the variables out of a collection of terms.

Parameters:
t - the terms
Returns:
the list of variables
Throws:
IllegalArgumentException - if the collection is null

getTupleVariablesList

public static List<IVariable> getTupleVariablesList(Collection<? extends ITuple> t)
Retrieves the variables out of a collection of tuples.

Parameters:
t - the tuples
Returns:
the list of variables
Throws:
IllegalArgumentException - if the collection is null

getLiteralVariablesList

public static List<IVariable> getLiteralVariablesList(Collection<? extends ILiteral> l)
Retrieves the variables out of a collection of literals.

Parameters:
t - the literals
Returns:
the list of variables
Throws:
IllegalArgumentException - if the collection is null

getTermVariables

public static Set<IVariable> getTermVariables(Collection<? extends ITerm> t)
Retrieves the variables out of a collection of terms.

Parameters:
t - the terms
Returns:
the list of variables
Throws:
IllegalArgumentException - if the collection is null

getTupleVariables

public static Set<IVariable> getTupleVariables(Collection<? extends ITuple> t)
Retrieves the variables out of a collection of tuples.

Parameters:
t - the tuples
Returns:
the list of variables
Throws:
IllegalArgumentException - if the collection is null

getLiteralVariables

public static Set<IVariable> getLiteralVariables(Collection<? extends ILiteral> l)
Retrieves the variables out of a collection of literals.

Parameters:
t - the literals
Returns:
the list of variables
Throws:
IllegalArgumentException - if the collection is null

getVariablesList

public static List<IVariable> getVariablesList(ITerm... t)
Retrieves the variables out of a array of terms.

Parameters:
t - the terms
Returns:
the list of variables
Throws:
IllegalArgumentException - if the collection is null

getVariablesList

public static List<IVariable> getVariablesList(ITuple... t)
Retrieves the variables out of a array of tuples.

Parameters:
t - the tuples
Returns:
the list of variables
Throws:
IllegalArgumentException - if the collection is null

getVariablesList

public static List<IVariable> getVariablesList(ILiteral... l)
Retrieves the variables out of a array of literals.

Parameters:
t - the literals
Returns:
the list of variables
Throws:
IllegalArgumentException - if the collection is null

getVariables

public static Set<IVariable> getVariables(ITerm... t)
Retrieves the variables out of a array of terms.

Parameters:
t - the terms
Returns:
the list of variables
Throws:
IllegalArgumentException - if the collection is null

getVariables

public static Set<IVariable> getVariables(ITuple... t)
Retrieves the variables out of a array of tuples.

Parameters:
t - the tuples
Returns:
the list of variables
Throws:
IllegalArgumentException - if the collection is null

getVariables

public static Set<IVariable> getVariables(ILiteral... l)
Retrieves the variables out of a array of literals.

Parameters:
t - the literals
Returns:
the list of variables
Throws:
IllegalArgumentException - if the collection is null