提交 56fb3686 authored 作者: Thomas Mueller's avatar Thomas Mueller

H2 Console: improved autocomplete feature (also simplified the source code for this feature).

上级 3226f510
......@@ -13,13 +13,6 @@ import java.util.HashMap;
*/
public interface Rule {
/**
* Get the name of the rule.
*
* @return the name
*/
String name();
/**
* Update cross references.
*
......
......@@ -33,10 +33,6 @@ public class RuleElement implements Rule {
visitor.visitRuleElement(keyword, name, link);
}
public String name() {
return name;
}
public void setLinks(HashMap<String, RuleHead> ruleMap) {
if (link != null) {
link.setLinks(ruleMap);
......@@ -81,8 +77,4 @@ public class RuleElement implements Rule {
return link.autoComplete(sentence);
}
public String toString() {
return name;
}
}
......@@ -33,10 +33,6 @@ public class RuleFixed implements Rule {
visitor.visitRuleFixed(type);
}
public String name() {
return "type="+type;
}
public void setLinks(HashMap<String, RuleHead> ruleMap) {
// nothing to do
}
......@@ -201,8 +197,4 @@ public class RuleFixed implements Rule {
return false;
}
public String toString() {
return name();
}
}
......@@ -38,10 +38,6 @@ public class RuleList implements Rule {
visitor.visitRuleList(or, list);
}
public String name() {
return null;
}
public void setLinks(HashMap<String, RuleHead> ruleMap) {
if (!mapSet) {
for (Rule r : list) {
......@@ -75,8 +71,4 @@ public class RuleList implements Rule {
}
}
public String toString() {
return or ? "or: " : "" + list.toString();
}
}
......@@ -23,10 +23,6 @@ public class RuleOptional implements Rule {
visitor.visitRuleOptional(rule);
}
public String name() {
return null;
}
public void setLinks(HashMap<String, RuleHead> ruleMap) {
if (!mapSet) {
rule.setLinks(ruleMap);
......@@ -41,8 +37,4 @@ public class RuleOptional implements Rule {
return true;
}
public String toString() {
return rule.toString();
}
}
......@@ -25,10 +25,6 @@ public class RuleRepeat implements Rule {
visitor.visitRuleRepeat(comma, rule);
}
public String name() {
return rule.name();
}
public void setLinks(HashMap<String, RuleHead> ruleMap) {
// rule.setLinks(ruleMap);
}
......@@ -43,8 +39,4 @@ public class RuleRepeat implements Rule {
return true;
}
public String toString() {
return rule.toString();
}
}
......@@ -34,29 +34,6 @@ public class DbContextRule implements Rule {
this.type = type;
}
public String toString() {
switch (type) {
case SCHEMA:
return "schema";
case TABLE:
return "table";
case NEW_TABLE_ALIAS:
return "nt";
case TABLE_ALIAS:
return "t";
case COLUMN_ALIAS:
return "c";
case COLUMN:
return "column";
default:
return "?";
}
}
public String name() {
return null;
}
public void setLinks(HashMap<String, RuleHead> ruleMap) {
// nothing to do
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论