3604 |
26 Jul 07 |
nicklas |
1 |
/** |
3604 |
26 Jul 07 |
nicklas |
$Id$ |
3604 |
26 Jul 07 |
nicklas |
3 |
|
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Nicklas Nordborg |
3604 |
26 Jul 07 |
nicklas |
5 |
|
3604 |
26 Jul 07 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
3604 |
26 Jul 07 |
nicklas |
Available at http://base.thep.lu.se/ |
3604 |
26 Jul 07 |
nicklas |
8 |
|
3604 |
26 Jul 07 |
nicklas |
BASE is free software; you can redistribute it and/or |
3604 |
26 Jul 07 |
nicklas |
modify it under the terms of the GNU General Public License |
4479 |
05 Sep 08 |
jari |
as published by the Free Software Foundation; either version 3 |
3604 |
26 Jul 07 |
nicklas |
of the License, or (at your option) any later version. |
3604 |
26 Jul 07 |
nicklas |
13 |
|
3604 |
26 Jul 07 |
nicklas |
BASE is distributed in the hope that it will be useful, |
3604 |
26 Jul 07 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
3604 |
26 Jul 07 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3604 |
26 Jul 07 |
nicklas |
GNU General Public License for more details. |
3604 |
26 Jul 07 |
nicklas |
18 |
|
3604 |
26 Jul 07 |
nicklas |
You should have received a copy of the GNU General Public License |
4515 |
11 Sep 08 |
jari |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
3604 |
26 Jul 07 |
nicklas |
21 |
*/ |
3604 |
26 Jul 07 |
nicklas |
22 |
package net.sf.basedb.util.jep.convert; |
3604 |
26 Jul 07 |
nicklas |
23 |
|
3604 |
26 Jul 07 |
nicklas |
24 |
|
3604 |
26 Jul 07 |
nicklas |
25 |
import net.sf.basedb.core.query.Expression; |
3604 |
26 Jul 07 |
nicklas |
26 |
import net.sf.basedb.core.query.Restriction; |
3604 |
26 Jul 07 |
nicklas |
27 |
import net.sf.basedb.util.jep.Jep; |
3604 |
26 Jul 07 |
nicklas |
28 |
import net.sf.basedb.util.jep.JepExpressionFunction; |
3604 |
26 Jul 07 |
nicklas |
29 |
|
3604 |
26 Jul 07 |
nicklas |
30 |
/** |
3604 |
26 Jul 07 |
nicklas |
Convert a built-in JEP function or operation to a Query |
3604 |
26 Jul 07 |
nicklas |
API {@link Expression} or {@link Restriction}. Custom function |
3604 |
26 Jul 07 |
nicklas |
should implement {@link JepExpressionFunction} which supports |
3604 |
26 Jul 07 |
nicklas |
automatic conversion. |
3604 |
26 Jul 07 |
nicklas |
35 |
|
3604 |
26 Jul 07 |
nicklas |
@author nicklas |
3604 |
26 Jul 07 |
nicklas |
@version 2.4 |
3604 |
26 Jul 07 |
nicklas |
@base.modified $Date$ |
3604 |
26 Jul 07 |
nicklas |
39 |
*/ |
3604 |
26 Jul 07 |
nicklas |
40 |
public interface JepConversionFunction<T> |
3604 |
26 Jul 07 |
nicklas |
41 |
{ |
3604 |
26 Jul 07 |
nicklas |
42 |
/** |
3604 |
26 Jul 07 |
nicklas |
If this converter is a built-in function. Built-in functions |
3604 |
26 Jul 07 |
nicklas |
are automatically put in the enumeration return by |
3604 |
26 Jul 07 |
nicklas |
{@link Jep#getFunctions()}. |
3604 |
26 Jul 07 |
nicklas |
@return TRUE if it is a function, FALSE otherwise |
3604 |
26 Jul 07 |
nicklas |
47 |
*/ |
3604 |
26 Jul 07 |
nicklas |
48 |
public boolean isFunction(); |
3604 |
26 Jul 07 |
nicklas |
49 |
|
3604 |
26 Jul 07 |
nicklas |
50 |
/** |
3604 |
26 Jul 07 |
nicklas |
If this converter is a built-in operator. |
3604 |
26 Jul 07 |
nicklas |
@return TRUE if it is an operator, FALSE otherwise |
3604 |
26 Jul 07 |
nicklas |
53 |
*/ |
3604 |
26 Jul 07 |
nicklas |
54 |
public boolean isOperator(); |
3604 |
26 Jul 07 |
nicklas |
55 |
|
3604 |
26 Jul 07 |
nicklas |
56 |
/** |
3604 |
26 Jul 07 |
nicklas |
Get the name of the function or the symbol of the operator |
3604 |
26 Jul 07 |
nicklas |
@return The name or symbol or null |
3604 |
26 Jul 07 |
nicklas |
59 |
*/ |
3604 |
26 Jul 07 |
nicklas |
60 |
public String getName(); |
3604 |
26 Jul 07 |
nicklas |
61 |
|
3604 |
26 Jul 07 |
nicklas |
62 |
/** |
3604 |
26 Jul 07 |
nicklas |
Get a short description of the function or operator |
3604 |
26 Jul 07 |
nicklas |
@return The description or null |
3604 |
26 Jul 07 |
nicklas |
65 |
*/ |
3604 |
26 Jul 07 |
nicklas |
66 |
public String getDescription(); |
3604 |
26 Jul 07 |
nicklas |
67 |
|
3604 |
26 Jul 07 |
nicklas |
68 |
/** |
3604 |
26 Jul 07 |
nicklas |
Convert the object to an expression. |
3604 |
26 Jul 07 |
nicklas |
@param node The object to convert |
3604 |
26 Jul 07 |
nicklas |
@return An expression or null |
3604 |
26 Jul 07 |
nicklas |
@throws UnsupportedOperationException If this converter can't convert to |
3604 |
26 Jul 07 |
nicklas |
expressions |
3604 |
26 Jul 07 |
nicklas |
74 |
*/ |
3604 |
26 Jul 07 |
nicklas |
75 |
public Expression toExpression(T node); |
3604 |
26 Jul 07 |
nicklas |
76 |
|
3604 |
26 Jul 07 |
nicklas |
77 |
/** |
3604 |
26 Jul 07 |
nicklas |
Convert the object to a restriction. |
3604 |
26 Jul 07 |
nicklas |
@param node The object to convert |
3604 |
26 Jul 07 |
nicklas |
@return A restriction or null |
3604 |
26 Jul 07 |
nicklas |
@throws UnsupportedOperationException If this converter can't convert to |
3604 |
26 Jul 07 |
nicklas |
restrictions |
3604 |
26 Jul 07 |
nicklas |
83 |
*/ |
3604 |
26 Jul 07 |
nicklas |
84 |
public Restriction toRestriction(T node); |
3604 |
26 Jul 07 |
nicklas |
85 |
} |