org.mmbase.storage.search.implementation
Class BasicStep

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

public class BasicStep
extends Object
implements Step, Serializable

Basic implementation. The step alias is not set on default.

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

Field Summary
protected  String alias
           
protected  String builder
           
protected  boolean modifiable
           
protected  SortedSet<Integer> nodes
          Nodenumber set for nodes to be included (ordered using integer comparison).
 
Constructor Summary
BasicStep(String builder)
          Constructor.
 
Method Summary
 Step addNode(int nodeNumber)
          Adds node to nodes.
 boolean equals(Object obj)
          Compares this step to the specified object.
 String getAlias()
          Gets the alias associated with this step.
 SortedSet<Integer> getNodes()
          Gets nodenumbers for nodes that must be included in this step.
 String getTableName()
          Gets the associated builder.
 int hashCode()
           
 BasicStep setAlias(String alias)
          Sets alias property.
 void setUnmodifiable()
           
 String toString()
          Returns a string representation of this Step.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

builder

protected final String builder

alias

protected String alias

nodes

protected SortedSet<Integer> nodes
Nodenumber set for nodes to be included (ordered using integer comparison).


modifiable

protected boolean modifiable
Constructor Detail

BasicStep

BasicStep(String builder)
Constructor.

Parameters:
builder - The builder.
Throws:
IllegalArgumentException - when an invalid argument is supplied.
Method Detail

setAlias

public BasicStep setAlias(String alias)
Sets alias property.

Parameters:
alias - The alias property.
Returns:
This BasicStep instance.
Throws:
IllegalArgumentException - when an invalid argument is supplied.

addNode

public Step addNode(int nodeNumber)
Adds node to nodes.

Specified by:
addNode in interface Step
Parameters:
nodeNumber - The nodenumber of the node.
Returns:
This BasicStep instance.
Throws:
IllegalArgumentException - when an invalid argument is supplied.

getTableName

public String getTableName()
Gets the associated builder.

Specified by:
getTableName in interface Step
Returns:
The builder.

getAlias

public String getAlias()
Description copied from interface: Step
Gets the alias associated with this step.

This corresponds to a table alias in SQL SELECT-syntax.

Specified by:
getAlias in interface Step

getNodes

public SortedSet<Integer> getNodes()
Description copied from interface: Step
Gets nodenumbers for nodes that must be included in this step. A null value indicates that no such constraint is applied.

This corresponds to a "number IN (....)" constraint in SQL SELECT syntax.

Note that this can also be achieved by using a FieldValueInConstraint on the "number" field.

Specified by:
getNodes in interface Step

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 Step
Overrides:
equals in class Object
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 Step
Overrides:
hashCode in class Object

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 Step
Overrides:
toString in class Object
Returns:
A string representation of this Step.

setUnmodifiable

public void setUnmodifiable()
Specified by:
setUnmodifiable in interface Step


MMBase 2.0-SNAPSHOT - null