AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

switch case question

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
Petterson Mikael
Guest





PostPosted: Thu Sep 23, 2004 7:27 am    Post subject: switch case question Reply with quote



Hi,

Will the code below work as:" if devFaultType is equal to
RbsTypes.RBS_DEV_FAULT_GENERAL_HW_ERROR or
RbsTypes.RBS_DEV_FAULT_TOO_LOW_MAIN_LOAD or ...
RbsTypes.RBS_DEV_FAULT_TMP_SENSOR_FAULT then set result equals true?".

//M

switch(devFaultType)
{
case RbsTypes.RBS_DEV_FAULT_GENERAL_HW_ERROR:
case RbsTypes.RBS_DEV_FAULT_TOO_LOW_MAIN_LOAD:
case RbsTypes.RBS_DEV_FAULT_TOO_LOW_PRIO_LOAD:
case RbsTypes.RBS_DEV_FAULT_TOO_HIGH_MAIN_LOAD:
case RbsTypes.RBS_DEV_FAULT_TMP_SENSOR_FAULT:
result=true;
break;
default:
.....
}

Back to top
VisionSet
Guest





PostPosted: Thu Sep 23, 2004 7:38 am    Post subject: Re: switch case question Reply with quote





"Petterson Mikael" <mikael.petterson (AT) ericsson (DOT) se> wrote

Quote:
Hi,

Will the code below work as:" if devFaultType is equal to
RbsTypes.RBS_DEV_FAULT_GENERAL_HW_ERROR or
RbsTypes.RBS_DEV_FAULT_TOO_LOW_MAIN_LOAD or ...
RbsTypes.RBS_DEV_FAULT_TMP_SENSOR_FAULT then set result equals true?".

//M

switch(devFaultType)
{
case RbsTypes.RBS_DEV_FAULT_GENERAL_HW_ERROR:
case RbsTypes.RBS_DEV_FAULT_TOO_LOW_MAIN_LOAD:
case RbsTypes.RBS_DEV_FAULT_TOO_LOW_PRIO_LOAD:
case RbsTypes.RBS_DEV_FAULT_TOO_HIGH_MAIN_LOAD:
case RbsTypes.RBS_DEV_FAULT_TMP_SENSOR_FAULT:
result=true;
break;
default:
.....
}

It will return true for all the cases given except default.

--
Mike W



Back to top
Paul Lutus
Guest





PostPosted: Thu Sep 23, 2004 8:12 am    Post subject: Re: switch case question Reply with quote



Petterson Mikael wrote:

Quote:
Hi,

Will the code below work as:" if devFaultType is equal to
RbsTypes.RBS_DEV_FAULT_GENERAL_HW_ERROR or
RbsTypes.RBS_DEV_FAULT_TOO_LOW_MAIN_LOAD or ...
RbsTypes.RBS_DEV_FAULT_TMP_SENSOR_FAULT then set result equals true?".

What happened when you ran your code of which this this is an uncompilable
part? How can you hold the the opinion of some Usenet posters above what
your compiler tells you? If you really want our opinion, post a short,
complete, compilable, working example.

--
Paul Lutus
http://www.arachnoid.com


Back to top
Thomas Schodt
Guest





PostPosted: Thu Sep 23, 2004 12:44 pm    Post subject: Re: switch case question Reply with quote

Petterson Mikael wrote:

Quote:
switch(devFaultType) {
case RbsTypes.RBS_DEV_FAULT_GENERAL_HW_ERROR:

IIRC you need tiger to use final values from other classes in a
switch/case statement.
Also note that those final values are compiled into the bytecode, so if
you ever change the those final values you need to recompile all classes
that use them.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.