1 6 package tests.jfun.parsec.mssql; 7 8 13 final class Table { 14 private final QualifiedName qname; 15 private final Select stmt; 16 public String 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 37 public QualifiedName getName() { 38 return qname; 39 } 40 43 public Select getStmt() { 44 return stmt; 45 } 46 } 47 | Popular Tags |