hotspot/src/share/vm/libadt/vectset.cpp
changeset 10975 446510be531a
parent 8319 aedb3bd871bc
child 13195 be27e1b6a4b9
--- a/hotspot/src/share/vm/libadt/vectset.cpp	Thu Oct 27 14:40:25 2011 -0700
+++ b/hotspot/src/share/vm/libadt/vectset.cpp	Thu Oct 27 18:20:50 2011 -0700
@@ -350,6 +350,21 @@
   return (int)_xor;
 }
 
+//------------------------------iterate----------------------------------------
+// Used by Set::print().
+class VSetI_ : public SetI_ {
+  VectorSetI vsi;
+public:
+  VSetI_( const VectorSet *vset, uint &elem ) : vsi(vset) { elem = vsi.elem; }
+
+  uint next(void) { ++vsi; return vsi.elem; }
+  int  test(void) { return vsi.test(); }
+};
+
+SetI_ *VectorSet::iterate(uint &elem) const {
+  return new(ResourceObj::C_HEAP) VSetI_(this, elem);
+}
+
 //=============================================================================
 //------------------------------next-------------------------------------------
 // Find and return the next element of a vector set, or return garbage and