KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > albel > tags > table > model > NewRowColumns


1 /*
2  * NewRow.java
3  *
4  * Created on Penktadienis, 2004, Rugsėjo 10, 14.21
5  */

6
7 package albel.tags.table.model;
8
9 /**
10  *
11  * @author alblau
12  */

13 import org.apache.commons.collections.collection.*;
14 import org.apache.commons.collections.*;
15
16 public class NewRowColumns
17 {
18    private java.util.List JavaDoc columns=new java.util.ArrayList JavaDoc();
19     private Table table;
20     /** Creates a new instance of NewRow */
21     public NewRowColumns(Table table)
22     {
23         this.table=table;
24     }
25     private NewRowColumns()
26     {
27     }
28     
29     /**
30      * Getter for property columns.
31      * @return Value of property columns.
32      */

33     public java.util.List JavaDoc getColumns() {
34         return this.columns;
35     }
36      public boolean hasColumns()
37      {
38          return !columns.isEmpty();
39      }
40     
41     /**
42      * Setter for property columns.
43      * @param columns New value of property columns.
44      */

45     public void setColumns(java.util.List JavaDoc columns) {
46         this.columns = columns;
47     }
48     public boolean hasColumn(String JavaDoc name)
49     {
50         return CollectionUtils.exists(columns, PredicateUtils.equalPredicate(new Column(table,name)));
51     }
52     public void addColumn(Column col)
53     {
54         columns.add(col);
55     }
56     public Column getColumn(String JavaDoc prop)
57     {
58         return (Column)CollectionUtils.find(columns, PredicateUtils.equalPredicate(new Column(table,prop)));
59     }
60 }
61
Popular Tags