KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > extractor > algebra > Relation


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 package org.xquark.extractor.algebra;
24
25 import java.util.List JavaDoc;
26 import java.util.Set JavaDoc;
27
28 public interface Relation
29 {
30     /**
31      * Browse recursively operands for {@link Table} stopping on projections and
32      * BinaryAlgebra operations which are returned in place.
33      * Returns a set of {@link Relation} containing the same elements that
34      * {@link #visibleTableInstances()} for joins and {@link UnaryAlgebra} (group,
35      * sort, restrictions), and "this" for {@link BinaryAlgebra} (unions and
36      * other set operations), tables and projections.
37      * @return a cached object to clone if modification needed.
38      */

39     public Set JavaDoc providedTableInstances();
40
41     /**
42      * Browse recursively operands returning union of {@link Relation#providedTableInstances()}.
43      * Returns a set of {@link Relation} containing the union of
44      * {@link #providedTableInstances()} results on every operand and "this" for
45      * table nodes.
46      * To summerize, recursive search is performed almost as for {@link #providedTableInstances()}
47      * but one level (the operand level) is at least browsed so calling this
48      * method on a projection or a union will return the table(s) being
49      * projected contrary to {@link #providedTableInstances()}.
50      * @return a cached object to clone if modification needed.
51      */

52     public Set JavaDoc visibleTableInstances();
53
54     /**
55      */

56     public List JavaDoc getKeys();
57
58     /**
59      * Returns a list of items available in current subtree with a specified name.
60      * Uses responsibility chain.
61      * @param name the item name to be searched for.
62      * @return List a list of {@link Expression}
63      */

64     public List JavaDoc nameTest(String JavaDoc name);
65
66     /**
67      * Browse relation attributes until finding a non-nullable one.
68      * @return null if all relation attributes are nullable or relation has no attributes.
69      */

70     public AttributeExpression findNonNullAttribute();
71 }
72
Popular Tags