ca.sqlpower.architect
Class SQLIndex.Column

java.lang.Object
  extended by ca.sqlpower.architect.SQLObject
      extended by ca.sqlpower.architect.SQLIndex.Column
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
SQLIndex

public class SQLIndex.Column
extends SQLObject

A simple placeholder for a column. We're not using real SQLColumn instances here so that the tree of SQLObjects can remain tree-like. If we put the real SQLColumns in here, the columns would appear in two places in the tree (here and under the table's columns folder)!

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ca.sqlpower.architect.SQLObject
children, magicDisableCount, populated, undoEventListeners
 
Constructor Summary
SQLIndex.Column()
           
SQLIndex.Column(SQLColumn col, SQLIndex.AscendDescend ad)
          Creates a Column object that corresponds to a particular SQLColumn.
SQLIndex.Column(java.lang.String name, SQLIndex.AscendDescend ad)
          Creates a Column object that does not correspond to a particular column (such as an expression index).
 
Method Summary
 boolean allowsChildren()
          Returns true if and only if this object can have child SQLObjects.
 boolean equals(java.lang.Object obj)
           
 SQLIndex.AscendDescend getAscendingOrDescending()
           
 java.lang.Class<? extends SQLObject> getChildType()
           
 SQLColumn getColumn()
           
 SQLObject getParent()
          Returns the parent of this SQLObject or null if it is a root object such as SQLDatabase.
 java.lang.String getShortDisplayName()
          Returns a short string that should be displayed to the user for representing this SQLObject as a label.
 int hashCode()
           
 boolean isPopulated()
          Tells if this object has already been filled with children, or if that operation is still pending.
protected  void populate()
          Causes this SQLObject to load its children (if any exist).
 void setAscending(boolean ascending)
           
 void setAscendingOrDescending(java.lang.Object ad)
          This setter should be passed an enumerated item of type AscendDescend.
 void setColumn(SQLColumn column)
           
 void setDescending(boolean descending)
           
protected  void setParent(SQLObject parent)
          Parents call this on their children to update parent pointers during addChild and removeChild requests.
 java.lang.String toString()
           
 
Methods inherited from class ca.sqlpower.architect.SQLObject
addChild, addChild, addChildImpl, addSQLObjectListener, addSQLObjectPreEventListener, addUndoEventListener, endCompoundEdit, fireDbChildInserted, fireDbChildPreRemove, fireDbChildRemoved, fireDbChildrenInserted, fireDbChildrenPreRemove, fireDbChildrenRemoved, fireDbObjectChanged, fireDbStructureChanged, getChild, getChildByName, getChildByNameIgnoreCase, getChildCount, getChildren, getIndexOfChildByName, getName, getPhysicalName, getSQLObjectListeners, getSQLObjectPreEventListeners, getUndoEventListeners, isMagicEnabled, removeChild, removeChild, removeImpl, removeSQLObjectListener, removeSQLObjectPreEventListener, removeUndoEventListener, setMagicEnabled, setName, setPhysicalName, setPopulated, startCompoundEdit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLIndex.Column

public SQLIndex.Column(SQLColumn col,
                       SQLIndex.AscendDescend ad)
Creates a Column object that corresponds to a particular SQLColumn.


SQLIndex.Column

public SQLIndex.Column(java.lang.String name,
                       SQLIndex.AscendDescend ad)
Creates a Column object that does not correspond to a particular column (such as an expression index).


SQLIndex.Column

public SQLIndex.Column()
Method Detail

allowsChildren

public boolean allowsChildren()
Description copied from class: SQLObject
Returns true if and only if this object can have child SQLObjects. Your implementation of this method must not cause JDBC activity, or the lazy loading properties of your SQLObjects will be wasted! Typically, you will implement this with a hardcoded "return true" or "return false" depending on object type.

Specified by:
allowsChildren in class SQLObject

getChildType

public java.lang.Class<? extends SQLObject> getChildType()
Specified by:
getChildType in class SQLObject

getParent

public SQLObject getParent()
Description copied from class: SQLObject
Returns the parent of this SQLObject or null if it is a root object such as SQLDatabase.

Specified by:
getParent in class SQLObject

getShortDisplayName

public java.lang.String getShortDisplayName()
Description copied from class: SQLObject
Returns a short string that should be displayed to the user for representing this SQLObject as a label.

Specified by:
getShortDisplayName in class SQLObject

populate

protected void populate()
                 throws ArchitectException
Description copied from class: SQLObject
Causes this SQLObject to load its children (if any exist). This method will be called lots of times, so track whether or not you need to do anything and return right away whenever possible.

Specified by:
populate in class SQLObject
Throws:
ArchitectException

isPopulated

public boolean isPopulated()
Description copied from class: SQLObject
Tells if this object has already been filled with children, or if that operation is still pending.

Overrides:
isPopulated in class SQLObject

setParent

protected void setParent(SQLObject parent)
Description copied from class: SQLObject
Parents call this on their children to update parent pointers during addChild and removeChild requests.

Specified by:
setParent in class SQLObject

getColumn

public SQLColumn getColumn()

setColumn

public void setColumn(SQLColumn column)

getAscendingOrDescending

public SQLIndex.AscendDescend getAscendingOrDescending()

setAscendingOrDescending

public void setAscendingOrDescending(java.lang.Object ad)
This setter should be passed an enumerated item of type AscendDescend.


setAscending

public void setAscending(boolean ascending)

setDescending

public void setDescending(boolean descending)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca