3 ms·
[Disclaimer: I don't read Python, but I think the question here is "Which methods from this list does this object implement?" If I'm wrong please correct me.]
by patio11 17y ago
[Disclaimer: I don't read Python, but I think the question here is "Which methods from this list does this object implement?" If I'm wrong please correct me.]
My gut check was this should take about eight lines, plus imports and the class boilerplate. Let's try:
http://www.pastie.org/808727 http://www.pastie.org/808727
Yep, eight.
[Edit: It occurs to me the Python code might answer "Does this implement all specified methods?" That also takes eight lines in Java. I've appended the implementation above.]
- pvg 17y agoYou can take out another couple if you did a sensible thing like taking a Set<String> as input for method names and returned a Set<String> But like the other poster said, you're very unlikely to be doing this in Java, making the whole thing take 0 lines and 129.4 fewer insufferable smugness units.