1 package xdoclet.modules.ojb.model; 2 3 17 18 import java.util.ArrayList ; 19 import java.util.Iterator ; 20 21 26 public class IndexDef extends DefBase 27 { 28 29 private ArrayList _columns = new ArrayList (); 30 31 private boolean _isUnique = false; 32 33 39 public IndexDef(String name, boolean isUnique) 40 { 41 super(name == null ? "" : name); 42 _isUnique = isUnique; 43 } 44 45 50 public boolean isDefault() 51 { 52 return (getName() == null) || (getName().length() == 0); 53 } 54 55 60 public boolean isUnique() 61 { 62 return _isUnique; 63 } 64 65 70 public void addColumn(String column) 71 { 72 if (!_columns.contains(column)) 73 { 74 _columns.add(column); 75 } 76 } 77 78 83 public Iterator getColumns() 84 { 85 return _columns.iterator(); 86 } 87 } 88 | Popular Tags |