h.Use the getNext() method to determine the next question in the sub- interview.

Every question except the Final question must provide a getNext() method that determines the next (successor) question or null. Alternatively, if the Framework’s interview extension library is used, it’s possible to link questions without subclassing via Question.setPathResolver() or Question.linkTo() methods. For detailed information, see the com.sun.tck.j2me.interview.lib package API documentation.

The following code in the SampleInterview example specifies the next configuration question.

Question qXXX =

{

Question getNext() {

 

return qNextQuestion;

}

};

i.Repeat Step e through Step h until all configuration questions are added to the sub-interview.

34 Java ME TCK Framework Developer’s Guide • July 2007

Page 54
Image 54
Sun Microsystems 1.2 manual Question qXXX = Question getNext Return qNextQuestion