1 5 package org.h2.bnf; 6 7 import java.util.HashMap ; 8 import java.util.HashSet ; 9 10 import org.h2.server.web.DbTableOrView; 11 12 public class Sentence { 13 public static final int CONTEXT=0, KEYWORD=1; 14 public static final int FUNCTION = 2; 15 public String text; 16 HashMap next; 17 long max; 18 DbTableOrView lastTable; 19 private HashSet tables; 20 private HashMap aliases; 21 22 public boolean stop() { 23 return System.currentTimeMillis() > max; 24 } 25 26 public void add(String n, String string, int type) { 27 next.put(type+"#"+n, string); 28 } 29 30 public void addAlias(String alias, DbTableOrView table) { 31 if(aliases == null) { 32 aliases = new HashMap (); 33 } 34 aliases.put(alias, table); 35 } 36 37 public void addTable(DbTableOrView table) { 38 lastTable = table; 39 if(tables==null) { 40 tables = new HashSet (); 41 } 42 tables.add(table); 43 } 44 45 public HashSet getTables() { 46 return tables; 47 } 48 49 public HashMap getAliases() { 50 return aliases; 51 } 52 53 public DbTableOrView getLastTable() { 54 return lastTable; 55 } 56 } 57 | Popular Tags |