From 105aa7384d1d90e5dd528a5b79d41bf52fce7830 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 12 Jun 2003 05:24:08 +0000 Subject: [PATCH] Added toArray(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2651 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/miso/util/ObjectSet.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/miso/util/ObjectSet.java b/src/java/com/threerings/miso/util/ObjectSet.java index c69f19acc..3d49347de 100644 --- a/src/java/com/threerings/miso/util/ObjectSet.java +++ b/src/java/com/threerings/miso/util/ObjectSet.java @@ -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; @@ -104,6 +104,16 @@ public class ObjectSet 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. */