All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.adapters.ObjectArray

java.lang.Object
   |
   +----COM.objectspace.jgl.adapters.ArrayAdapter
           |
           +----COM.objectspace.jgl.adapters.ObjectArray

public class ObjectArray
extends ArrayAdapter
ObjectArray allows a native array of Objects to be accessed like a Container. It is particularly useful for applying generic algorithms such as Sorting.sort() to a native array.


Constructor Index

 o ObjectArray()
Construct myself to refer to an empty array.
 o ObjectArray(Array)
Construct myself to be a copy of an existing Array.
 o ObjectArray(Object[])
Construct myself to refer to a native Java array.
 o ObjectArray(ObjectArray)
Construct myself to refer to an existing ObjectArray.

Method Index

 o at(int)
Return the object at the specified index.
 o begin()
Return an iterator positioned at my first item.
 o clone()
Return a shallow copy of myself.
 o elements()
Return an Enumeration of my elements.
 o end()
Return an iterator positioned immediately after my last item.
 o equals(Object)
Return true if I'm equal to a specified object.
 o equals(Object[])
Return true if I contain the same items in the same order as a native array of Objects.
 o finish()
Return an iterator positioned immediately after my last item.
 o get()
Retrieve the underlying primitive array.
 o maxSize()
Return the maximum number of objects that I can contain.
 o put(int, Object)
Set the object at a specified index.
 o size()
Return the number of objects that I contain.
 o start()
Return an iterator positioned at my first item.
 o toString()
Return a string that describes me.

Constructors

 o ObjectArray
 public ObjectArray()
Construct myself to refer to an empty array.

 o ObjectArray
 public ObjectArray(ObjectArray array)
Construct myself to refer to an existing ObjectArray.

Parameters:
array - The ObjectArray to copy.
 o ObjectArray
 public ObjectArray(Array array)
Construct myself to be a copy of an existing Array.

Parameters:
array - The Array to copy.
 o ObjectArray
 public ObjectArray(Object array[])
Construct myself to refer to a native Java array.

Parameters:
array - The Object[] to ape.

Methods

 o clone
 public synchronized Object clone()
Return a shallow copy of myself.

Overrides:
clone in class ArrayAdapter
 o toString
 public synchronized String toString()
Return a string that describes me.

Overrides:
toString in class Object
 o equals
 public boolean equals(Object object)
Return true if I'm equal to a specified object.

Parameters:
object - The object to compare myself against.
Returns:
true if I'm equal to the specified object.
Overrides:
equals in class ArrayAdapter
 o equals
 public synchronized boolean equals(Object array[])
Return true if I contain the same items in the same order as a native array of Objects.

Parameters:
array - The array to compare myself against.
 o get
 public Object[] get()
Retrieve the underlying primitive array.

 o size
 public int size()
Return the number of objects that I contain.

Overrides:
size in class ArrayAdapter
 o maxSize
 public int maxSize()
Return the maximum number of objects that I can contain.

Overrides:
maxSize in class ArrayAdapter
 o elements
 public Enumeration elements()
Return an Enumeration of my elements.

Overrides:
elements in class ArrayAdapter
 o start
 public ForwardIterator start()
Return an iterator positioned at my first item.

Overrides:
start in class ArrayAdapter
 o begin
 public synchronized ObjectIterator begin()
Return an iterator positioned at my first item.

 o finish
 public ForwardIterator finish()
Return an iterator positioned immediately after my last item.

Overrides:
finish in class ArrayAdapter
 o end
 public synchronized ObjectIterator end()
Return an iterator positioned immediately after my last item.

 o at
 public synchronized Object at(int index)
Return the object at the specified index.

Parameters:
index - The index.
Overrides:
at in class ArrayAdapter
 o put
 public synchronized void put(int index,
                              Object object)
Set the object at a specified index. The object must be a Integer

Parameters:
index - The index.
object - The object to place at the specified index.
Throws: IndexOutOfBoundsException
if index is not in range.
Overrides:
put in class ArrayAdapter

All Packages  Class Hierarchy  This Package  Previous  Next  Index