org.mmbase.storage.search
Interface RelationStep

All Superinterfaces:
Step

public interface RelationStep
extends Step

A relationstep refers to a table of relations between the previous and next step. Relationstep are used to create a path of related objects.

This corresponds to a constraint joining the three tables in SQL SELECT-syntax.

Note that tables can also be joined using FieldCompareConstraints.

Since:
MMBase-1.7
Version:
$Id: RelationStep.java,v 1.7 2004/02/23 19:01:03 pierre Exp $
Author:
Rob van Maris

Field Summary
static java.lang.String[] DIRECTIONALITY_NAMES
          Directionality names corresponding to the direction values.
static int DIRECTIONS_ALL
          Directionality following relations both ways, including unidirectional relations.
static int DIRECTIONS_BOTH
          Directionality following relations both ways (source to destination AND destination to source).
static int DIRECTIONS_DESTINATION
          Directionality following relations from source to destination.
static int DIRECTIONS_EITHER
          Directionality following relations from destination to source.
static int DIRECTIONS_SOURCE
          Directionality following relations from destination to source.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this relationstep to the specified object.
 boolean getCheckedDirectionality()
          Gets the value of the checkedDirectionality property.
 int getDirectionality()
          Gets the directionality mode used with this relation.
 Step getNext()
          Gets the next step.
 Step getPrevious()
          Gets the previous step.
 java.lang.Integer getRole()
          Gets the role for this relation, if specified.
 int hashCode()
           
 java.lang.String toString()
          Returns a string representation of this RelationStep.
 
Methods inherited from interface org.mmbase.storage.search.Step
getAlias, getNodes, getTableName
 

Field Detail

DIRECTIONS_BOTH

public static final int DIRECTIONS_BOTH
Directionality following relations both ways (source to destination AND destination to source). Whether unidirectional relations are shown is dependent on the value of the checkedDirectionality property.

See Also:
Constant Field Values

DIRECTIONS_DESTINATION

public static final int DIRECTIONS_DESTINATION
Directionality following relations from source to destination. E.g. where the previous step is source and the next step is destination. Whether unidirectional relations are shown is dependent on the value of the checkedDirectionality property.

See Also:
Constant Field Values

DIRECTIONS_SOURCE

public static final int DIRECTIONS_SOURCE
Directionality following relations from destination to source. E.g. where the previous step is destination and the next step is source. This value ignores the value of the checkedDirectionality property.

See Also:
Constant Field Values

DIRECTIONS_ALL

public static final int DIRECTIONS_ALL
Directionality following relations both ways, including unidirectional relations. This value ignores the value of the checkedDirectionality property.

See Also:
Constant Field Values

DIRECTIONS_EITHER

public static final int DIRECTIONS_EITHER
Directionality following relations from destination to source. E.g. where the previous step is destination and the next step is source. Whether unidirectional relations are shown is dependent on the value of the checkedDirectionality property.

See Also:
Constant Field Values

DIRECTIONALITY_NAMES

public static final java.lang.String[] DIRECTIONALITY_NAMES
Directionality names corresponding to the direction values. As a result DIRECTIONALITY_NAMES[directionality] is the directionality name: "both", "destnation", "source", "all" or "either".

Method Detail

getCheckedDirectionality

public boolean getCheckedDirectionality()
Gets the value of the checkedDirectionality property. This property determines how uni/bi-directionality affects which relations are followed from destination to source, when the directionality property is set to DIRECTIONS_SOURCE or DIRECTIONS_BOTH.

When this value is true, only bi-directional relations are followed from destination to source. Otherwise unidirectional relations are followed from destination to source as well.


getDirectionality

public int getDirectionality()
Gets the directionality mode used with this relation. This is one of values defined in this class.


getRole

public java.lang.Integer getRole()
Gets the role for this relation, if specified. I.e. the nodenumber of the corresponding RelDef node, or null.


getPrevious

public Step getPrevious()
Gets the previous step.


getNext

public Step getNext()
Gets the next step.


equals

public boolean equals(java.lang.Object obj)
Compares this relationstep to the specified object. The result is true if and only if the argument is a non-null RelationStep object with the same directionality and role, associated with the same tablename, using the same alias and including the same nodes.

Specified by:
equals in interface Step
Parameters:
obj - The object to compare with.
Returns:
true if the objects are equal, false otherwise.
See Also:
Step.equals(java.lang.Object)

hashCode

public int hashCode()
Specified by:
hashCode in interface Step

toString

public java.lang.String toString()
Returns a string representation of this RelationStep. The string representation has the form "RelationStep(tablename:<tablename>, alias:<alias>, nodes:<nodes>, dir:<dir>, role:<role>)" where

Specified by:
toString in interface Step
Returns:
A string representation of this RelationStep.


MMBase build 1.7.4.20050922