Any way in Groovy/Java to identify the subclass calling a static method?
问题 Groovy is so powerful I wonder whether there's an easy way to do this. The scenario: I have an abstract class, AbstractSequence . Then I have two (more in reality) subclasses, called say CasedSequence and LowerCaseSequence . Each of these concrete classes has to have an "identity map", i.e. like a Set but where it is possible to extract an element based on functional equality (overriding of equals and hashCode ). So we have: class CasedSequence extends AbstractSequence { static Map