interface Window{ //定义Window接口,表示窗口操作 public void open(); //窗口打开 public void close(); //窗口关闭 public void activated(); //窗口活动 public void iconified(); //窗口最小化 public void deiconified(); //窗口恢复大小 }
abstract class WindowAdapter implements Window{ //定义抽象类实现接口,在此类中覆写方法,但是所有的方法体为空 public void open() {} //窗口打开 public void close() {}; //窗口关闭 public void activated() {}; //窗口活动 public void iconified() {}; //窗口最小化 public void deiconified() {}; //窗口恢复大小 }
class WindowImp1 extends WindowAdapter{ //子类直接继承WindowAdapter类,有选择地实现需要的方法 public void open() { //窗口打开 System.out.println("窗口打开"); } public void close() { //窗口关闭 System.out.println("窗口关闭"); } }
public class Adapter_demo {
public static void main(String[] args) { // TODO 自动生成的方法存根 Window win = new WindowImp1(); //实现接口对象 win.open(); win.close(); }
at org.apache.impala.analysis.TableRef.<init>(TableRef.java:138) at org.apache.impala.analysis.CUP$SqlParser$actions.case421(SqlParser.java:18035) at org.apache.impala.analysis.CUP$SqlParser$actions.CUP$SqlParser$do_action(SqlParser.java:5976) at org.apache.impala.analysis.SqlParser.do_action(SqlParser.java:1349) at java_cup.runtime.lr_parser.parse(lr_parser.java:587) at com.xxxx.xx.core.parser.XXXXTest.getLineageInfo(XXXXTest.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53) Caused by: java.lang.ClassNotFoundException: org.apache.sentry.core.model.db.DBModelAction at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 28 more