Call Java Method with enum parameter

26 ビュー (過去 30 日間)
Taiwo
Taiwo 2011 年 10 月 17 日
編集済み: David 2019 年 6 月 13 日
How can i call a Java Class and pass an enum parameter into the method. Eg when i do the methodsview Security: I have the class show as : (java.lang.String,atp.com.Security$Type,java.lang.String,atp.com.Security$Broker)

回答 (1 件)

David
David 2019 年 6 月 13 日
編集済み: David 2019 年 6 月 13 日
There is an explanation here:
It took me a while to make it work because my ennumeration 'EstimationMethod' is an inner class of 'SeatsSpecification',
public class SeatsSpecification implements IProcSpecification, Cloneable {
....
public static enum EstimationMethod {
Burman, KalmanSmoother, McElroyMatrix
}
....
}
and in this case I had to proceed as follows to define my three parameters in the ennumeration:
Burman=javaMethod('valueOf','ec.satoolkit.seats.SeatsSpecification$EstimationMethod', 'KalmanSmoother')
KalmanSmoother=javaMethod('valueOf','ec.satoolkit.seats.SeatsSpecification$EstimationMethod', 'Burman')
McElroyMatrix=javaMethod('valueOf','ec.satoolkit.seats.SeatsSpecification$EstimationMethod', 'McElroyMatrix')

カテゴリ

Help Center および File ExchangeCall Java from MATLAB についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by