org.axiondb
Class ColumnIdentifier

java.lang.Object
  extended byorg.axiondb.NamedIdentifier
      extended byorg.axiondb.ColumnIdentifier
All Implemented Interfaces:
Selectable, Serializable

public class ColumnIdentifier
extends NamedIdentifier
implements Selectable

An identifier for a column.

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

Version:
$Revision: 1.18 $ $Date: 2004/09/09 23:47:45 $
See Also:
Serialized Form

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 .
 String getAlias()
          Returns my column alias name, if any.
 ColumnIdentifier getCanonicalIdentifier()
           
 DataType getDataType()
          Returns my DataType, if any.
 String getLabel()
          Returns my column alias or name.
 String getName()
          Returns the name of my column, 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 setAlias(String column)
          Sets my column alias name, if any.
 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.
 void setVariableContext(VariableContext ctx)
           
 String toString()
          Returns a String representation of me, suitable for debugging output.
 
Methods inherited from class org.axiondb.NamedIdentifier
toUpperOrNull
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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

ColumnIdentifier

public ColumnIdentifier(TableIdentifier table,
                        String columnName,
                        String columnAlias)
Parameters:
table - my table, which may be null
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
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.


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

getAlias

public String getAlias()
Returns my column alias name, if any.

Specified by:
getAlias in interface Selectable

getCanonicalIdentifier

public ColumnIdentifier getCanonicalIdentifier()

getDataType

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

Specified by:
getDataType in interface Selectable

getLabel

public String getLabel()
Returns my column alias or name.

Specified by:
getLabel in interface Selectable

getName

public String getName()
Returns the name of my column, if any.

Specified by:
getName in interface Selectable

getTableAlias

public 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 TableIdentifier getTableIdentifier()
Returns my table identifier, if any.


getTableName

public 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.


setAlias

public void setAlias(String column)
Sets my column alias name, if any.


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 " .".


setTableIdentifier

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


setVariableContext

public void setVariableContext(VariableContext ctx)
Specified by:
setVariableContext in interface Selectable

toString

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