Obtain the collection of Control
s
from the object that implements this interface.
Since a single object can implement multiple
Control
interfaces, it's necessary
to check each object against different Control
types. For example:
Controllable controllable;
:
Control cs[];
cs = controllable.getControls();
for (int i = 0; i < cs.length; i++) {
if (cs[i] instanceof ControlTypeA)
doSomethingA();
if (cs[i] instanceof ControlTypeB)
doSomethingB();
// etc.
}
The list of Control
objects returned
will not contain any duplicates. And the list will not
change over time.
If no Control
is supported, a zero length
array is returned.