Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top