Java equivalent of Ruby ObjectSpace.each_object -
I'm looking for a way to get all the types of instant objects in Java.
With Ruby you can use the ObjectSpace.each_object method:
a = 102.7 b = 95.1 ObjectSpace.each_object {numeric} {| X | Px}
95.1 102.7
is not equal to this
In this way you can do something in Java that every class will have to create and maintain a collection of all the examples. IMO, this would be a bad idea, unless there are exceptional circumstances that justify overheads. For starters, the "All Examples" collection will need to be implemented in such a way that avoid garbage retention.
Comments
Post a Comment