工业仪表与自动化装置
工業儀錶與自動化裝置
공업의표여자동화장치
INDUSTRIAL INSTRUMENTATION & AUTOMATION
2015年
2期
108-111
,共4页
Jess%Java%构造函数%功能扩展函数%加载
Jess%Java%構造函數%功能擴展函數%加載
Jess%Java%구조함수%공능확전함수%가재
Jess%Java%constructor%extending function%install
Jess功能函数的扩展是使用Java语言实现Userfunction接口来完成的。实现该接口的Java类的构造函数有默认或空参数的,也有带参数的。针对load-function命令不能向Jess中加载带参数构造函数的Java类,且在加载多个默认或空参数构造函数的Java类时略显冗繁的问题,提出无论实现Userfunction接口的Java类是何种构造函数,都可通过先期实现Jess提供的Userpack-age接口,再使用命令load-package来完成Jess功能扩展函数的加载,这为Jess功能扩展函数提供了通用的、一次性整体加载的高效方法。该方法被应用在楼宇温度控制仿真系统的应用开发中。
Jess功能函數的擴展是使用Java語言實現Userfunction接口來完成的。實現該接口的Java類的構造函數有默認或空參數的,也有帶參數的。針對load-function命令不能嚮Jess中加載帶參數構造函數的Java類,且在加載多箇默認或空參數構造函數的Java類時略顯冗繁的問題,提齣無論實現Userfunction接口的Java類是何種構造函數,都可通過先期實現Jess提供的Userpack-age接口,再使用命令load-package來完成Jess功能擴展函數的加載,這為Jess功能擴展函數提供瞭通用的、一次性整體加載的高效方法。該方法被應用在樓宇溫度控製倣真繫統的應用開髮中。
Jess공능함수적확전시사용Java어언실현Userfunction접구래완성적。실현해접구적Java류적구조함수유묵인혹공삼수적,야유대삼수적。침대load-function명령불능향Jess중가재대삼수구조함수적Java류,차재가재다개묵인혹공삼수구조함수적Java류시략현용번적문제,제출무론실현Userfunction접구적Java류시하충구조함수,도가통과선기실현Jess제공적Userpack-age접구,재사용명령load-package래완성Jess공능확전함수적가재,저위Jess공능확전함수제공료통용적、일차성정체가재적고효방법。해방법피응용재루우온도공제방진계통적응용개발중。
The Java class which implements the Jess Userfunction interface can extend Jess function. Some of these classes require constructor arguments, although the others don’ t require. If the method which installing the Java class into Jess is the Jess function call of load-function, then the Java class which it requires constructor arguments will not be installed into Jess. At the same time, it will be tire-some when many Java class installed into Jess by calling the Jess function load-function, even if these Ja-va classes don’ t require constructor arguments. In order to solve this problem, this paper proposes a uni-versal method which can install the Java classes into Jess. This method is composed of two parts:the first is implement the Jess interface of load-package, the second is calling Jess function load-package. This method can install the Java classes together into Jess one at a time. This method is also applied in a building temperature control simulated system.