org.axiondb
Class ColumnIdentifier

java.lang.Object
  extended by org.axiondb.BaseSelectable
      extended by org.axiondb.ColumnIdentifier
All Implemented Interfaces:
Serializable, Selectable

public class ColumnIdentifier
extends BaseSelectable
implements Selectable

An identifier for a column.

Column names and aliases always stored (and returned) in upper case.

Version:
$Revision: 1.25 $ $Date: 2006/01/10 21:02:37 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.axiondb.BaseSelectable
_hash
 
Constructor Summary
ColumnIdentifier(String column)
           
ColumnIdentifier(TableIdentifier table, String columnName)
           
ColumnIdentifier(TableIdentifier table, String columnName, String columnAlias)
           
ColumnIdentifier(TableIdentifier table, String columnName, String columnAlias, DataType type)
           
 
Method Summary
 boolean equals(Object otherobject)
          Returns true iff otherobject is a ColumnIdentifier whose name, table identifier, and alias are equal to mine.
 Object evaluate(RowDecorator row)
          Returns the value of the column I identify within the given row .
 ColumnIdentifier getCanonicalIdentifier()
           
 DataType getDataType()
          Returns my DataType, if any.
 String getTableAlias()
          Returns the alias name of my table or null.
 TableIdentifier getTableIdentifier()
          Returns my table identifier, if any.
 String getTableName()
          Returns the name of my table or null.
 int hashCode()
          Returns a hash code in keeping with the standard equals/ hashCodecontract.
 void setDataType(DataType type)
          Sets my DataType, if any.
 void setName(String column)
          Sets the name of this column, and the name of my table if the given name includes " .".
 void setTableIdentifier(TableIdentifier table)
          Sets my table identifier, if any.
 String toString()
          Returns a String representation of me, suitable for debugging output.
 
Methods inherited from class org.axiondb.BaseSelectable
getAlias, getLabel, getName, setAlias, setVariableContext
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.axiondb.Selectable
getAlias, getLabel, getName, setVariableContext
 

Constructor Detail

ColumnIdentifier

public ColumnIdentifier(String column)
Parameters:
column - the local name of my column

ColumnIdentifier

public ColumnIdentifier(TableIdentifier table,
                        String columnName)
Parameters:
table - my table, which may be null
column - my column

ColumnIdentifier

public ColumnIdentifier(TableIdentifier table,
                        String columnName,
                        String columnAlias)
Parameters:
table - my table, which may be null
column - my column
columnAlias - the alias for my column, which may be null

ColumnIdentifier

public ColumnIdentifier(TableIdentifier table,
                        String columnName,
                        String columnAlias,
                        DataType type)
Parameters:
table - my table, which may be null
column - my column
columnAlias - the alias for my column, which may be null
type - the DataTypeof my column, which may be null
Method Detail

equals

public boolean equals(Object otherobject)
Returns true iff otherobject is a ColumnIdentifier whose name, table identifier, and alias are equal to mine.

Overrides:
equals in class Object

evaluate

public Object evaluate(RowDecorator row)
                throws AxionException
Returns the value of the column I identify within the given row .

Specified by:
evaluate in interface Selectable
Throws:
AxionException

getCanonicalIdentifier

public ColumnIdentifier getCanonicalIdentifier()

getDataType

public final DataType getDataType()
Returns my DataType, if any.

Specified by:
getDataType in interface Selectable

getTableAlias

public final String getTableAlias()
Returns the alias name of my table or null. Unlike getTableIdentifier().getTableAlias() this method will return null when I don't have a table identifier.


getTableIdentifier

public final TableIdentifier getTableIdentifier()
Returns my table identifier, if any.


getTableName

public final String getTableName()
Returns the name of my table or null. Unlike getTableIdentifier().getTableName() this method will return null when I don't have a table identifier.


hashCode

public int hashCode()
Returns a hash code in keeping with the standard equals/ hashCodecontract.

Overrides:
hashCode in class Object

setDataType

public void setDataType(DataType type)
Sets my DataType, if any.


setName

public void setName(String column)
Sets the name of this column, and the name of my table if the given name includes " .".

Overrides:
setName in class BaseSelectable

setTableIdentifier

public void setTableIdentifier(TableIdentifier table)
Sets my table identifier, if any.


toString

public String toString()
Returns a String representation of me, suitable for debugging output.

Overrides:
toString in class Object