KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > tests > jfun > parsec > mssql > Table


1 /*
2  * Created on 2004-11-16
3  *
4  * Author Ben Yu
5  */

6 package tests.jfun.parsec.mssql;
7
8 /**
9  * @author Ben Yu
10  *
11  * 2004-11-16
12  */

13 final class Table {
14   private final QualifiedName qname;
15   private final Select stmt;
16   public String JavaDoc toString(){
17     if(qname != null)
18       return "" + qname;
19     else
20       return "(" + stmt + ")";
21   }
22   private Table(final QualifiedName q, final Select s){
23     this.qname = q;
24     this.stmt = s;
25   }
26   public static Table qname(final QualifiedName qn){
27     return new Table(qn, null);
28   }
29   public static Table select(final Select s){
30     return new Table(null, s);
31   }
32   public boolean isSelect(){return stmt != null;}
33   
34   /**
35    * @return Returns the qname.
36    */

37   public QualifiedName getName() {
38     return qname;
39   }
40   /**
41    * @return Returns the stmt.
42    */

43   public Select getStmt() {
44     return stmt;
45   }
46 }
47
Popular Tags