001: /*
002: * sqlc 1
003: * SQL Compiler
004: * Copyright (C) 2003 Hammurapi Group
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2 of the License, or (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019: *
020: * URL: http://www.hammurapi.biz/products/sqlc/index.html
021: * e-Mail: support@hammurapi.biz
022: */
023: package biz.hammurapi.sql.metadata;
024:
025: import java.io.Serializable;
026: import java.util.ArrayList;
027: import java.util.Iterator;
028: import java.util.List;
029:
030: import biz.hammurapi.util.VisitableBase;
031: import biz.hammurapi.util.Visitor;
032:
033: /**
034: * @author Pavel Vlasov
035: * @version $Revision: 1.3 $
036: */
037: public class IndexDescriptor extends VisitableBase implements
038: Serializable {
039: /**
040: * Comment for <code>serialVersionUID</code>
041: */
042: private static final long serialVersionUID = 7893466284201800465L;
043: private TableDescriptor tableDescriptor;
044:
045: IndexDescriptor(TableDescriptor tableDescriptor) {
046: this .tableDescriptor = tableDescriptor;
047: }
048:
049: private String name;
050: private IndexInfo info;
051: private List columns = new ArrayList();
052: private boolean isUnique;
053:
054: public boolean isUnique() {
055: return isUnique;
056: }
057:
058: void setUnique(boolean isUnique) {
059: this .isUnique = isUnique;
060: }
061:
062: public List getColumns() {
063: return columns;
064: }
065:
066: public void acceptChildren(Visitor visitor) {
067: Iterator it = columns.iterator();
068: while (it.hasNext()) {
069: visitor.visit(it.next());
070: }
071: }
072:
073: /**
074: * @param name The name to set.
075: */
076: void setName(String name) {
077: this .name = name;
078: }
079:
080: /**
081: * @return Returns the name.
082: */
083: public String getName() {
084: return name;
085: }
086:
087: /**
088: * @param info The info to set.
089: */
090: void setInfo(IndexInfo info) {
091: this .info = info;
092: }
093:
094: /**
095: * @return Returns the info.
096: */
097: public IndexInfo getInfo() {
098: return info;
099: }
100: }
|