org.mmbase.storage.search.implementation
Class BasicRelationStep

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

public class BasicRelationStep
extends BasicStep
implements RelationStep, Serializable

Basic implementation.

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

Since:
MMBase-1.7
Version:
$Id: BasicRelationStep.java 41982 2010-04-20 14:05:14Z michiel $
Author:
Rob van Maris
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mmbase.storage.search.implementation.BasicStep
alias, builder, modifiable, nodes
 
Fields inherited from interface org.mmbase.storage.search.RelationStep
DIRECTIONALITY_DESCRIPTIONS, DIRECTIONS_ALL, DIRECTIONS_BOTH, DIRECTIONS_DESTINATION, DIRECTIONS_EITHER, DIRECTIONS_SOURCE
 
Constructor Summary
BasicRelationStep(String builder, Step previous, Step next)
          Creator.
 
Method Summary
 boolean equals(Object obj)
          Compares this step to the specified object.
 boolean getCheckedDirectionality()
          Gets the value of the checkedDirectionality property.
 int getDirectionality()
          Gets the directionality mode used with this relation.
 String getDirectionalityDescription()
          Returns a description of the part
 Step getNext()
          Gets the next step.
 Step getPrevious()
          Gets the previous step.
 Integer getRole()
          Gets the role for this relation, if specified.
 String getRoleDescription()
           
 int hashCode()
           
 BasicRelationStep setCheckedDirectionality(boolean checkedDirectionality)
          Sets checkedDirectionality property.
 BasicRelationStep setDirectionality(int directionality)
          Sets directionality property.
 BasicRelationStep setRole(Integer role)
          Sets role property.
 String toString()
          Returns a string representation of this Step.
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicStep
addNode, getAlias, getNodes, getTableName, setAlias, setUnmodifiable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.storage.search.Step
addNode, getAlias, getNodes, getTableName, setUnmodifiable
 

Constructor Detail

BasicRelationStep

BasicRelationStep(String builder,
                  Step previous,
                  Step next)
Creator.

Parameters:
builder - The relation builder.
previous - The previous step.
next - The next step.
Throws:
IllegalArgumentException - when an invalid argument is supplied.
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:
IllegalArgumentException - when an invalid argument is supplied.

setRole

public BasicRelationStep setRole(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

getDirectionalityDescription

public String getDirectionalityDescription()
Returns a description of the part


getRole

public 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

getRoleDescription

public String getRoleDescription()

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(Object obj)
Description copied from interface: Step
Compares this step to the specified object. The result is true if and only if the argument is a non-null Step, but not RelationStep, object associated with the same tablename, using the same alias and including the same nodes.

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

hashCode

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

toString

public String toString()
Description copied from interface: Step
Returns a string representation of this Step. The string representation has the form "Step(tablename:<tablename>, alias:<alias>, nodes:<nodes>)" where

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


MMBase 2.0-SNAPSHOT - null