| JGL - The Generic Collection Library for Java |
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.
-
ObjectArray()
- Construct myself to refer to an empty array.
-
ObjectArray(Array)
- Construct myself to be a copy of an existing Array.
-
ObjectArray(Object[])
- Construct myself to refer to a native Java array.
-
ObjectArray(ObjectArray)
- Construct myself to refer to an existing ObjectArray.
-
at(int)
- Return the object at the specified index.
-
begin()
- Return an iterator positioned at my first item.
-
clone()
- Return a shallow copy of myself.
-
elements()
- Return an Enumeration of my elements.
-
end()
- Return an iterator positioned immediately after my last item.
-
equals(Object)
- Return true if I'm equal to a specified object.
-
equals(Object[])
- Return true if I contain the same items in the same order as
a native array of Objects.
-
finish()
- Return an iterator positioned immediately after my last item.
-
get()
- Retrieve the underlying primitive array.
-
maxSize()
- Return the maximum number of objects that I can contain.
-
put(int, Object)
- Set the object at a specified index.
-
size()
- Return the number of objects that I contain.
-
start()
- Return an iterator positioned at my first item.
-
toString()
- Return a string that describes me.
ObjectArray
public ObjectArray()
- Construct myself to refer to an empty array.
ObjectArray
public ObjectArray(ObjectArray array)
- Construct myself to refer to an existing ObjectArray.
- Parameters:
- array - The ObjectArray to copy.
ObjectArray
public ObjectArray(Array array)
- Construct myself to be a copy of an existing Array.
- Parameters:
- array - The Array to copy.
ObjectArray
public ObjectArray(Object array[])
- Construct myself to refer to a native Java array.
- Parameters:
- array - The Object[] to ape.
clone
public synchronized Object clone()
- Return a shallow copy of myself.
- Overrides:
- clone in class ArrayAdapter
toString
public synchronized String toString()
- Return a string that describes me.
- Overrides:
- toString in class Object
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
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.
get
public Object[] get()
- Retrieve the underlying primitive array.
size
public int size()
- Return the number of objects that I contain.
maxSize
public int maxSize()
- Return the maximum number of objects that I can contain.
- Overrides:
- maxSize in class ArrayAdapter
elements
public Enumeration elements()
- Return an Enumeration of my elements.
start
public ForwardIterator start()
- Return an iterator positioned at my first item.
begin
public synchronized ObjectIterator begin()
- Return an iterator positioned at my first item.
finish
public ForwardIterator finish()
- Return an iterator positioned immediately after my last item.
end
public synchronized ObjectIterator end()
- Return an iterator positioned immediately after my last item.
at
public synchronized Object at(int index)
- Return the object at the specified index.
- Parameters:
- index - The index.
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.
All Packages Class Hierarchy This Package Previous Next Index