ColumnEnumerationpublic class ColumnEnumeration extends Object implements Enumeration
Fields Summary |
---|
private oisoft.togetherx.scriptapi.UML.enums.UMLAttributeEnumeration | myAttributes | private Enumeration | myForeignKeys | private TableImpl | myTable | private Enumeration | myForeignColumns | private boolean | myPrimaryKeyOnly | private Object | myCurrent |
Constructors Summary |
---|
ColumnEnumeration(TableImpl table, SQLModelImpl model)
// private QryAttribute myLastAttribute;
// private Table myForeignTable = null;
// private Enumeration myForeignKeys = new EmptyEnumeration();
this(table,model,true);
| ColumnEnumeration(TableImpl table, SQLModelImpl model, boolean showForeignKeys)
this(table,model,showForeignKeys,false);
| ColumnEnumeration(TableImpl table, SQLModelImpl model, boolean showForeignKeys, boolean primaryKeyOnly)
myAttributes = table.getUMLClass().getAttributes();
myPrimaryKeyOnly = primaryKeyOnly;
myTable = table;
if( showForeignKeys ){
myForeignKeys = new ForeignKeyEnumeration(table,model,primaryKeyOnly);
}
else{
myForeignKeys = new EmptyEnumeration();
}
advance();
|
Methods Summary |
---|
private void | advance()
myCurrent = null;
while( myAttributes.hasMoreElements() ){
ColumnImpl tmp = (ColumnImpl)myTable.getColumn(myAttributes.getNextUMLAttribute());
if(!myPrimaryKeyOnly || tmp.isPrimaryKey()){
myCurrent = tmp;
break;
}
}
if(myCurrent == null){
while(!myForeignColumns.hasMoreElements() && myForeignKeys.hasMoreElements() ){
myForeignColumns = ((SQLForeignKey)myForeignKeys.nextElement()).getColumns();
}
if( myForeignColumns.hasMoreElements() ){
myCurrent = myForeignColumns.nextElement();
}
}
| public boolean | hasMoreElements()
return myCurrent != null;
| public java.lang.Object | nextElement()
Object result = myCurrent;
advance();
return result;
|
|