org.mmbase.storage.search.implementation
Class BasicRelationStep

java.lang.Object
  extended byorg.mmbase.storage.search.implementation.BasicStep
      extended byorg.mmbase.storage.search.implementation.BasicRelationStep
All Implemented Interfaces:
RelationStep, Step

public class BasicRelationStep
extends BasicStep
implements RelationStep

Basic implementation.

The checkedDirectionality property defaults to false. The directionality property defaults to DIRECTIONS_BOTH.

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

Field Summary
 
Fields inherited from interface org.mmbase.storage.search.RelationStep
DIRECTIONALITY_NAMES, DIRECTIONS_ALL, DIRECTIONS_BOTH, DIRECTIONS_DESTINATION, DIRECTIONS_EITHER, DIRECTIONS_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()
           
 BasicRelationStep setCheckedDirectionality(boolean checkedDirectionality)
          Sets checkedDirectionality property.
 BasicRelationStep setDirectionality(int directionality)
          Sets directionality property.
 BasicRelationStep setRole(java.lang.Integer role)
          Sets role property.
 java.lang.String toString()
          Returns a string representation of this RelationStep.
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicStep
addNode, getAlias, getBuilder, getNodes, getTableName, setAlias
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.storage.search.Step
getAlias, getNodes, getTableName
 

Method Detail

setCheckedDirectionality

public BasicRelationStep setCheckedDirectionality(boolean checkedDirectionality)
Sets checkedDirectionality property.

Parameters:
checkedDirectionality - The checkedDirectionality property.
Returns:
This BasicRelationStep instance.
See Also:
getCheckedDirectionality()

setDirectionality

public BasicRelationStep setDirectionality(int directionality)
Sets directionality property.

Parameters:
directionality - The directionality. Must be one of the values defined in RelationStep.
Returns:
This BasicRelationStep instance.
Throws:
java.lang.IllegalArgumentException - when an invalid argument is supplied.

setRole

public BasicRelationStep setRole(java.lang.Integer role)
Sets role property.

Parameters:
role - The role.
Returns:
This BasicRelationStep instance.

getCheckedDirectionality

public boolean getCheckedDirectionality()
Description copied from interface: RelationStep
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 RelationStep.DIRECTIONS_SOURCE or RelationStep.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.

Specified by:
getCheckedDirectionality in interface RelationStep

getDirectionality

public int getDirectionality()
Description copied from interface: RelationStep
Gets the directionality mode used with this relation. This is one of values defined in this class.

Specified by:
getDirectionality in interface RelationStep

getRole

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

Specified by:
getRole in interface RelationStep

getPrevious

public Step getPrevious()
Description copied from interface: RelationStep
Gets the previous step.

Specified by:
getPrevious in interface RelationStep

getNext

public Step getNext()
Description copied from interface: RelationStep
Gets the next step.

Specified by:
getNext in interface RelationStep

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: RelationStep
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 RelationStep
Overrides:
equals in class BasicStep

hashCode

public int hashCode()
Specified by:
hashCode in interface RelationStep
Overrides:
hashCode in class BasicStep

toString

public java.lang.String toString()
Description copied from interface: RelationStep
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 RelationStep
Overrides:
toString in class BasicStep


MMBase build 1.7.1.20041002