scranton
Class ArraySupport

java.lang.Object
  extended byscranton.ArraySupport

public class ArraySupport
extends java.lang.Object

Support the process of inserting (in) or removing (out) an object for a collection in an array at the indicated position and moving the remaining objects to adjust for the insertion or removal


Constructor Summary
ArraySupport()
           
 
Method Summary
 void arrayInsert(java.lang.Object[] a, int in, int actual, java.lang.Object O)
          Insert an object into the array at the indicated position and move the objects at the position or following it to make room for the move.
 java.lang.Object arrayRemove(java.lang.Object[] a, int out, int actual)
          Remove the object at a[out] and move the following objects to shrink the number of objects by one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArraySupport

public ArraySupport()
Method Detail

arrayInsert

public void arrayInsert(java.lang.Object[] a,
                        int in,
                        int actual,
                        java.lang.Object O)
Insert an object into the array at the indicated position and move the objects at the position or following it to make room for the move.

Parameters:
a - The array of objects
in - Where the new object is to be placed
actual - The number of objects in the array a[0...actual)
O - The objects that is inserted in a[in]

arrayRemove

public java.lang.Object arrayRemove(java.lang.Object[] a,
                                    int out,
                                    int actual)
Remove the object at a[out] and move the following objects to shrink the number of objects by one.

Parameters:
a - The array of objects
out - Where the new object is to be placed
actual - The number of objects in the array a[0...actual)
Returns:
The objects that was at a[out]