org.mmbase.storage.search.implementation
Class BasicStepField

java.lang.Object
  extended byorg.mmbase.storage.search.implementation.BasicStepField
All Implemented Interfaces:
StepField
Direct Known Subclasses:
BasicAggregatedField

public class BasicStepField
extends Object
implements StepField

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

Since:
MMBase-1.7
Version:
$Id: BasicStepField.java,v 1.23 2006/07/04 13:04:00 michiel Exp $
Author:
Rob van Maris

Constructor Summary
BasicStepField(Step step, CoreField field)
          Constructor.
 
Method Summary
 boolean equals(Object obj)
          Compares this stepfield to the specified object.
 String getAlias()
          Gets the alias for the associated field.
 CoreField getField()
          Gets the associated field.
 String getFieldName()
          Gets the name of the associated field (without prefix).
static String getFieldName(StepField field)
          Returns the field's fieldname, possibly extended with the step's name if known.
 Step getStep()
          Gets the step associated with this fieldstep.
 int getType()
          Gets the type of the associated field.
 int hashCode()
           
 BasicStepField setAlias(String alias)
          Sets alias property.
 String toString()
          Returns a string representation of this StepField.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicStepField

public BasicStepField(Step step,
                      CoreField field)
Constructor.

Parameters:
step - The associated step.
field - The associated field.
Throws:
IllegalArgumentException - when an invalid argument is supplied.
Method Detail

setAlias

public BasicStepField setAlias(String alias)
Sets alias property.

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

getField

public CoreField getField()
Gets the associated field.

Returns:
The field.

getFieldName

public String getFieldName()
Description copied from interface: StepField
Gets the name of the associated field (without prefix).

This corresponds to the fieldname in SQL SELECT-syntax.

Specified by:
getFieldName in interface StepField

getAlias

public String getAlias()
Description copied from interface: StepField
Gets the alias for the associated field.

This corresponds to the field alias in SQL SELECT-syntax.

Specified by:
getAlias in interface StepField

getStep

public Step getStep()
Description copied from interface: StepField
Gets the step associated with this fieldstep.

Specified by:
getStep in interface StepField

getType

public int getType()
Description copied from interface: StepField
Gets the type of the associated field. This is one of the values defined in Field.

Specified by:
getType in interface StepField

equals

public boolean equals(Object obj)
Description copied from interface: StepField
Compares this stepfield to the specified object. The result is true if and only if the argument is a non-null StepField object associated with the same field, using the same alias.

Specified by:
equals in interface StepField

hashCode

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

getFieldName

public static String getFieldName(StepField field)
Returns the field's fieldname, possibly extended with the step's name if known. May return null or partial fieldnames if not all data is available (for use in debugging).

Parameters:
field - the fieldname whose name to return

toString

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

Specified by:
toString in interface StepField


MMBase build 1.8.1.20060716