Added toArray().

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2651 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-06-12 05:24:08 +00:00
parent 1c7fbbdccf
commit 105aa7384d
@@ -1,5 +1,5 @@
// //
// $Id: ObjectSet.java,v 1.2 2003/04/22 01:57:44 mdb Exp $ // $Id: ObjectSet.java,v 1.3 2003/06/12 05:24:08 mdb Exp $
package com.threerings.miso.util; package com.threerings.miso.util;
@@ -104,6 +104,16 @@ public class ObjectSet
Arrays.fill(_objs, null); Arrays.fill(_objs, null);
} }
/**
* Converts the contents of this object set to an array.
*/
public ObjectInfo[] toArray ()
{
ObjectInfo[] info = new ObjectInfo[_size];
System.arraycopy(_objs, 0, info, 0, _size);
return info;
}
/** /**
* Returns a string representation of this instance. * Returns a string representation of this instance.
*/ */