Added ability to copy ourselves into another array at an offset.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1044 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert@gmail.com
2003-01-31 02:27:48 +00:00
parent d969878d8c
commit 8c7b6e251e
@@ -1,5 +1,5 @@
//
// $Id: ArrayIntSet.java,v 1.10 2002/12/19 22:41:13 mdb Exp $
// $Id: ArrayIntSet.java,v 1.11 2003/01/31 02:27:48 mdb Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne
@@ -118,6 +118,19 @@ public class ArrayIntSet extends AbstractSet
return values;
}
/**
* Serializes this int set into an array at the specified offset. The
* array must be large enough to hold all the integers in our set at
* the offset specified.
*
* @return the array passed in.
*/
public int[] toIntArray (int[] target, int offset)
{
System.arraycopy(_values, 0, target, offset, _size);
return target;
}
// documentation inherited from interface
public boolean add (Object o)
{