HiRISE

HiRISE.HiReport.sql
Class Column

java.lang.Object
  extended by HiRISE.HiReport.sql.Column
All Implemented Interfaces:
Comparable<Column>

public class Column
extends Object
implements Comparable<Column>

Represents an individual column in a table, or a particular SQL function as a virtual column.


Field Summary
protected  String alias
          alias for name
protected  String name
          name of column
protected  Table table
          reference to table
 
Constructor Summary
Column(Table table, String name, int type)
          Create a new column.
Column(Table table, String alias, String name, int type)
          Create a new column.
 
Method Summary
 int compareTo(Column column)
          Compare this column to another column for sorting.
 boolean equals(Object o)
          Compare this column to another object.
 String getAlias()
          Get the alias name for this column.
 String getName()
          Returns column name, not qualified by the table prefix.
 Table getTable()
          Get the table to which this column belongs.
 int getType()
           
 int hashCode()
           
 boolean isAliased()
          If true, this column has been aliased to a different name or to a function.
 String toString()
          The string representation of this column or function, used to build an SQL statement.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

table

protected Table table
reference to table


name

protected String name
name of column


alias

protected String alias
alias for name

Constructor Detail

Column

public Column(Table table,
              String name,
              int type)
Create a new column.

Parameters:
table - parent table
name - column name
type - JDBC type

Column

public Column(Table table,
              String alias,
              String name,
              int type)
Create a new column.

Parameters:
table - parent table
name - column name
alias - alias for name
type - JDBC type
Method Detail

getType

public int getType()
Returns:
the type

getTable

public Table getTable()
Get the table to which this column belongs.

Returns:
reference to parent table

toString

public String toString()
The string representation of this column or function, used to build an SQL statement.

Overrides:
toString in class Object

equals

public boolean equals(Object o)
Compare this column to another object. Two columns are equal if they belong to the same table and have the same name.

Overrides:
equals in class Object
Parameters:
o - Should be another column

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Column column)
Compare this column to another column for sorting. The comparison is done by name without regard to case.

Specified by:
compareTo in interface Comparable<Column>
Parameters:
column - another
Returns:
0 if equal, negative is less, positive if greater

getName

public String getName()
Returns column name, not qualified by the table prefix.

Returns:
name of column

getAlias

public String getAlias()
Get the alias name for this column.

Returns:
Alias

isAliased

public boolean isAliased()
If true, this column has been aliased to a different name or to a function.

Returns:
True if aliased

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona