KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > dql > plan > condition > SingleColumnPredicate


1 package com.daffodilwoods.daffodildb.server.sql99.dql.plan.condition;
2
3 import com.daffodilwoods.daffodildb.server.sql99.expression.booleanvalueexpression.predicates.*;
4 import com.daffodilwoods.database.resource.*;
5 /**
6  * This class represents all predicate for single column of Table.
7  * <p>Title: </p>
8  * <p>Description: </p>
9  * <p>Copyright: Copyright (c) 2004</p>
10  * <p>Company: </p>
11  * @author not attributable
12  * @version 1.0
13  */

14 public class SingleColumnPredicate implements _SingleColumnPredicate {
15   /**
16    * It represents columnname for which this predicate define.
17    */

18   private String JavaDoc columnName;
19   /**
20    * It represents predicate for the column.
21    */

22   private predicate Predicate;
23   /**
24    * boolean flag set true,when predicate is of type Like.
25    */

26   private boolean isLikePredicate;
27
28    public SingleColumnPredicate() {
29    }
30    /**
31     * See Documentation of following method in _singlecolumnPredicate.
32     * @param predicate
33     * @throws DException
34     */

35    public void setPredicate(predicate predicate) throws DException {
36       this.Predicate = predicate;
37    }
38
39    public void setColumnName(String JavaDoc columnName) throws DException {
40       this.columnName = columnName;
41    }
42
43    public String JavaDoc toString() {
44       String JavaDoc str = "SINGLECOLUMNPREDICATE";
45       str += "[" + columnName + "]";
46       if (Predicate != null) {
47          str += "[" + Predicate + "]";
48       }
49       return str;
50    }
51
52    public int getPredicateType() throws DException {
53       return Predicate.getPredicateType();
54    }
55
56    public String JavaDoc getColumnName() throws DException {
57       return columnName;
58    }
59
60    public predicate getPredicate() throws DException {
61       return Predicate;
62    }
63
64    public boolean isLikePredicate() throws DException {
65       return isLikePredicate;
66    }
67
68    public void setLikePredicate() throws DException {
69       isLikePredicate = true;
70    }
71 }
72
Popular Tags