// no element found
public static <T extends ColumnSet> boolean fillColumnSets(Catalog catalog, Schema schema, Collection<T> output,
            final int tClassifierId) {
        // --- precondition
        if (catalog == null && schema == null) {
            return false;
        }
        RelationalSwitch<T> relationalSwitch = new RelationalSwitch<T>() {
            @Override
            protected T doSwitch(int classifierID, EObject theEObject) {
                if (theEObject.eClass().getClassifierID() != tClassifierId) {
                    return null;
                } else {
                    return super.doSwitch(classifierID, theEObject);
                }
            }
            @Override
            public T caseColumnSet(ColumnSet object) {
                return castObject(object);
            }
            @Override
            public T caseTable(Table object) {
                return castObject(object);
            }
            @Override
            public T caseTdTable(TdTable object) {
                return castObject(object);
            }
            @Override
            public T caseTdView(TdView object) {
                return castObject(object);
            }
            @Override
            public T caseView(View object) {
                return castObject(object);
            }
            @SuppressWarnings("unchecked")
            private T castObject(Object object) {
                return (T) object;
            }
        };
        EList<ModelElement> elements = (schema != null) ? schema.getOwnedElement() : catalog.getOwnedElement();
        if (elements.isEmpty()) {
            // no element found
            return false;
        }
        for (EObject elt : elements) {
            T columnSet = relationalSwitch.doSwitch(elt);
            if (columnSet != null) {
                output.add(columnSet);
            }
        }
        return true;
    }
EList<ModelElement> elements = (schema != null) ? schema.getOwnedElement() : catalog.getOwnedElement();
if (elements.isEmpty()) {
// no element found
return false;
}
public T caseView(View object) {
return castObject(object);
}
@SuppressWarnings("unchecked")
private T castObject(Object object) {
return (T) object;
}
};
EList<ModelElement> elements = (schema != null) ? schema.getOwnedElement() : catalog.getOwnedElement();
if (elements.isEmpty()) {
// no element found
return false;
}
for (EObject elt : elements) {
T columnSet = relationalSwitch.doSwitch(elt);
if (columnSet != null) {
output.add(columnSet);
}
}
return true;
}
}
@Override
public T caseTdTable(TdTable object) {
return castObject(object);
}
@Override
public T caseTdView(TdView object) {
return castObject(object);
}
@Override
public T caseView(View object) {
return castObject(object);
}
@SuppressWarnings("unchecked")
private T castObject(Object object) {
return (T) object;
}
};
EList<ModelElement> elements = (schema != null) ? schema.getOwnedElement() : catalog.getOwnedElement();
if (elements.isEmpty()) {
// no element found
return false;
}
for (EObject elt : elements) {
T columnSet = relationalSwitch.doSwitch(elt);
if (columnSet != null) {
output.add(columnSet);
}
}
return true;
}