I have a class which implements Handler.Callback
So, in my code i have something like this :
@Override
public boolean handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what)
{
case ThreadMessages.MSG_1:
{
break;
}
case ThreadMessages.MSG_2:
{
break;
}
case ThreadMessages.MSG_3:
{
break;
}
case ThreadMessages.MSG_4:
{
break;
}
case ThreadMessages.MSG_5:
{
break;
}
}
return false;
}
How should i comment this method to reflect the messages that my class can handle ?
The purpose here , is to let a developer know what message he can send to the class without having to read the source code , just using the java doc.
Thanks
My Advice:
In class
ThreadMessagesRenameMSG_1and the other static fields to some meaningful names.Above your
handleMessageAdd the following comments:
And in class
ThreadMessagesExplain each static feild by adding above it