Miro, which part are you confused with? I am assuming the third line
as it uses nested tertiary operators (the ? : bit).
It could be written otherwise as:
String vForwardName = "";
if (aActionMapping.findForward(vWorkForwardName) == null) {
if (visForm) {
vForwardName = "form";
}
else {
vForwardName = "task";
}
else {
vForwardName = vWorkForwardName;
}
The ? : operator is used to specify what value to assign a variable
based upon a boolean condition.
ie
variable = condition ? value if true : value if false
This can be nested as above - it's more succint than using if/else
logic, but a little more obscure.
HTH
Chris
On 7/31/06, temp temp <[EMAIL PROTECTED]> wrote:
How to read the following code ?
boolean vIsForm = vWorkTypeId.equals(IFormflowWorkTypeIds.FORM);
String vWorkForwardName = MessageFormat.format("work={0}", new Object[]
{vWorkAlias});
String vForwardName = (aActionMapping.findForward(vWorkForwardName)
== null)
? (vIsForm) ? "form" : "task"
: vWorkForwardName;
Thanks
Miro
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]