Representing method overloading in Java using Visual Paradigm (VP UML) class diagrams

1.5k Views Asked by At

I need to represent overloaded methods like this:

+setAttribute(int)
+setAttribute(float)
+setAttribute(boolean)

in a a single Java class. VP UML does not allow me to type in duplicate method names. If I try to do this, the program will revert the name to something like +operation1(). Is there a setting akin to "allow duplicate method names in a class" in VP UML? Is there another UML compliant way I can represent method overloading perhaps?

I've searched the documentation exhaustively and scoured forums and help files. Nothing that I can find seems to address this issue at all. That leads me to believe I'm doing something fundamentally wrong. Please help!

Thanks in advance for any suggestions.

1

There are 1 best solutions below

0
On BEST ANSWER

If you only write setAttribute(int), VP thinks that int is the name of the parameter and not its type. So you can't have two methods with the same type (since VP cannot deduce the type they have the same type). Use instead setAttribute(i:int), setAttribute(f:float), etc.