KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > storage > search > RelationStep


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.storage.search;
11
12 /**
13  * A relationstep refers to a table of relations between the previous and next step. Relationstep are used to create a path of related objects.
14  * <p>
15  * This corresponds to a constraint joining the three tables in SQL SELECT-syntax.
16  * <p>
17  * Note that tables can also be joined using FieldCompareConstraints.
18  *
19  * @author Rob van Maris
20  * @version $Id: RelationStep.java,v 1.9 2005/04/25 14:56:57 pierre Exp $
21  * @since MMBase-1.7
22  */

23 public interface RelationStep extends Step {
24
25     /**
26      * Directionality following relations both ways (source to destination AND destination to source).
27      * Whether unidirectional relations are shown is dependent on the value of the checkedDirectionality property.
28      */

29     int DIRECTIONS_BOTH = 0;
30
31     /**
32      * Directionality following relations from source to destination.
33      * E.g. where the previous step is source and the next step is destination.
34      * Whether unidirectional relations are shown is dependent on the value of the checkedDirectionality property.
35      */

36     int DIRECTIONS_DESTINATION = 1;
37
38     /**
39      * Directionality following relations from destination to source.
40      * E.g. where the previous step is destination and the next step is source.
41      * This value ignores the value of the checkedDirectionality property.
42      */

43     int DIRECTIONS_SOURCE = 2;
44
45
46     /**
47      * Directionality following relations both ways, including unidirectional relations.
48      * This value ignores the value of the checkedDirectionality property.
49      */

50     int DIRECTIONS_ALL = 4;
51
52     /**
53      * Directionality following relations from destination to source.
54      * E.g. where the previous step is destination and the next step is source.
55      * Whether unidirectional relations are shown is dependent on the value of the checkedDirectionality property.
56      */

57     int DIRECTIONS_EITHER = 5;
58
59     /**
60      * Directionality names corresponding to the direction values.
61      * As a result DIRECTIONALITY_DESCRIPTIONS[directionality] is the directionality
62      * name: "both", "destination", "source", "all" or "either".
63      */

64     public final static String JavaDoc[] DIRECTIONALITY_DESCRIPTIONS = new String JavaDoc[] {
65          "both",
66          "destination",
67          "source",
68          null, // reserved
69
"all",
70          "either"
71     };
72
73     /**
74      * Gets the value of the checkedDirectionality property. This property
75      * determines how uni/bi-directionality affects which relations are
76      * followed from destination to source, when the directionality property
77      * is set to {@link #DIRECTIONS_SOURCE} or {@link #DIRECTIONS_BOTH}.
78      * <p>
79      * When this value is true, only bi-directional relations are followed
80      * from destination to source.
81      * Otherwise unidirectional relations are followed from destination to
82      * source as well.
83      */

84     boolean getCheckedDirectionality();
85
86     /**
87      * Gets the directionality mode used with this relation. This is one of
88      * values defined in this class.
89      */

90     int getDirectionality();
91
92     /**
93      * Gets the role for this relation, if specified.
94      * I.e. the nodenumber of the corresponding
95      * {@link org.mmbase.module.corebuilders.RelDef RelDef} node, or
96      * <code>null</code>.
97      */

98     Integer JavaDoc getRole();
99
100     /**
101      * Gets the previous step.
102      */

103     Step getPrevious();
104
105     /**
106      * Gets the next step.
107      */

108     Step getNext();
109
110     /**
111      * Compares this relationstep to the specified object. The result is
112      * <code>true</code> if and only if the argument is a non-null
113      * RelationStep object with the same directionality and role,
114      * associated with the same tablename,
115      * using the same alias and including the same nodes.
116      *
117      * @param obj The object to compare with.
118      * @return <code>true</code> if the objects are equal,
119      * <code>false</code> otherwise.
120      * @see Step#equals
121      */

122     public boolean equals(Object JavaDoc obj);
123
124     // javadoc is inherited
125
public int hashCode();
126
127     /**
128      * Returns a string representation of this RelationStep.
129      * The string representation has the form
130      * "RelationStep(tablename:&lt;tablename&gt;, alias:&lt;alias&gt;,
131      * nodes:&lt;nodes&gt;, dir:&lt;dir&gt;, role:&lt;role&gt;)"
132      * where
133      * <ul>
134      * <li><em>&lt;tablename&gt;</em> is the tablename returnedby
135      * {@link #getTableName getTableName()}
136      * <li><em>&lt;alias&gt;</em> is the alias returned by {@link #getAlias getAlias()}
137      * <li><em>&lt;nodes&gt;</em> is the string representation of the ordered list
138      * of nodenumbers returned by {@link #getNodes getNodes()}
139      * <li><em>&lt;dir&gt;</em> is the name of
140      * the directionality returned by
141      * {@link #getDirectionality getDirectionality()}
142      * <li><em>&lt;role&gt;</em> is the role returned by
143      * {@link #getRole getRole()}
144      * </ul>
145      *
146      * @return A string representation of this RelationStep.
147      */

148     public String JavaDoc toString();
149
150     /** @link dependency
151      * @supplierRole previous*/

152     /*#Step lnkStep;*/
153
154     /** @link dependency
155      * @supplierRole next*/

156     /*#Step lnkStep1;*/
157 }
158
Popular Tags