Call Java Method with enum parameter

조회 수: 15 (최근 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 CenterFile Exchange에서 Call Java from MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by