JAVA的接口最大的作用就是统一:统一函数形式、调用方式,保证函数的进出都可以一致。 1、 多态接口动态加载 配合Class.forName().newInstance(),可以完成以函数为主的程序,这些函数可以统一入口参数。 接口中只写函数形式,具体实现则要到类中写: //Common. java public interface Common { double runTimer(double a, double b, double c); } //Car中实现这个接口a*b/c public class Car implements Common { public double runTimer(double a, double b, double c) { return ( a*b/c ); } } //Plane中实现这个接口a+b+c public class Plane implements Common { public double runTimer(double a, double b, double c) { return (a+ b + c); } 调用时则可以统一命名和调用 Common d=(Common) Class.forName("Car").newInstance(); v=d.runTimer(A,B,C); 2、 接口作为方法的参数传递 可以将接口类型的参数作为方法参数,在实际使用时可以将实现了接口的类传递给方法,后方法或按照重写的原则执行,实际调用的是实现类中的方法代码体,这样便根据传进屋的参数的不同而实现不同的功能。 interface Extendbroadable{ public void inPut(); } class KeyBroad implements Extendbroadable{ public void inPut(){ System.out.println("\n hi,keybroad has be input into then mainbroad!\n"); } } class NetCardBroad implements Extendbroadable{ public void inPut(){ System.out.println("\n hi,netCardBroad has be input into then mainbroad!\n"); } } //上面完成了一个接口,分别实现,接下来就是统一调用 class CheckBroad{ public void getMainMessage(Extendbroadable ext){ ext.inPut(); } } 具体使用 KeyBroad kb=new KeyBroad(); NetCardBroad ncb=new NetCardBroad(); CheckBroad cb=new CheckBroad(); cb.getMainMessage(kb); cb.getMainMessage(ncb);
2011年8月25日更新的MODIS Conversion Toolkit ,支持143种现有的modis数据产品直接处理,同时提供批量数据处理的IDL开发函数接口。 简介: The MODIS Conversion Toolkit (MCTK) is a plugin for ENVI that can ingest, process, and georeference every known MODIS product (currently 143) through your choice of an easy-to-use interactive widget interface or a fully-accessible programmatic interface. Supported products include: - Level 1A Uncalibrated Radiance - Level 1B Calibrated Radiance - Level 2 Swath - Level 2G, Level 3, and Level 4 Grid The interface allows you to take a "cafeteria" approach to MODIS data by providing a list of all available datasets within a file, from which you can choose the ones to process. The ENVI equivalents of MRT and MRTSwath are built in as well, which means that you can input a file, have its contents converted to scientifically meaningful values, and then project those contents into the coordinate system of your choice--all within one interface. Bow tie correction is also available for all swath products. The user guide (included with the plugin) contains: Descriptions of how the plugin interacts with each major MODIS product categoryScreen captures to aid in using the interactive versionA complete explanation of the programming interface with fully functional sample programs for each major MODIS product category.A list of all supported MODIS product。