All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class jgl.ArrayAdapter

java.lang.Object
    |
    +----jgl.ArrayAdapter

public abstract class ArrayAdapter
extends Object
implements Sequence
ArrayAdapter is the base class of all array adapters, including those that adapt the JDK Vector and Java native arrays.

Version:
JOS-FileSystem 4 Preview (25-Mar-98)
Author:
ObjectSpace, Inc.
See Also:
jgl.BooleanArray, jgl.ByteArray, jgl.CharArray, jgl.DoubleArray, jgl.FloatArray, jgl.IntArray, jgl.LongArray, jgl.ObjectArray, jgl.ShortArray, VectorArray

Constructor Index

 o ArrayAdapter()

Method Index

 o add(Object)
Add an object to myself.
 o back()
Return my last element.
 o clear()
Remove all of my objects.
 o clone()
 o contains(Object)
Return true if I contain a particular object using .equals()
 o count(int, int, Object)
Return the number of objects within a specified range of that match a particular value.
 o count(Object)
Return the number of objects that match a specified object.
 o equals(Object)
 o front()
Return my first element.
 o hashCode()
Return my hash code for support of hashing containers
 o indexOf(int, int, Object)
Return an index positioned at the first object within a specified range that matches a particular object, or -1 if the object is not found.
 o indexOf(Object)
Return the index of the first object that matches a particular value, or -1 if the object is not found.
 o isEmpty()
Return true if I contain no objects.
 o popBack()
Remove and return my last element.
 o popFront()
Remove and return my first element.
 o pushBack(Object)
Add an object at my end.
 o pushFront(Object)
Insert an object in front of my first element.
 o remove(int, int, Object)
Remove all elements within a specified range that match a particular object and return the number of objects that were removed.
 o remove(Object)
Remove all elements that match a specified object and return the number of objects that were removed.
 o replace(int, int, Object, Object)
Replace all elements within a specified range that match a particular object with a new value and return the number of objects that were replaced.
 o replace(Object, Object)
Replace all elements that match a particular object with a new value and return the number of objects that were replaced.

Constructors

 o ArrayAdapter
public ArrayAdapter()

Methods

 o clone
public Object clone()
Overrides:
clone in class Object
 o equals
public boolean equals(Object object)
Overrides:
equals in class Object
 o hashCode
public int hashCode()
Return my hash code for support of hashing containers

Overrides:
hashCode in class Object
 o isEmpty
public boolean isEmpty()
Return true if I contain no objects.

 o back
public Object back()
Return my last element.

 o front
public Object front()
Return my first element.

 o count
public int count(Object object)
Return the number of objects that match a specified object.

Parameters:
object - The object to count.
 o count
public int count(int first,
                 int last,
                 Object object)
Return the number of objects within a specified range of that match a particular value. the range is inclusive

Parameters:
first - The index of the first object to consider.
last - The index of the last object to consider.
Throws: IndexOutOfBoundsException
If either index is invalid.
 o replace
public int replace(Object oldValue,
                   Object newValue)
Replace all elements that match a particular object with a new value and return the number of objects that were replaced.

Parameters:
oldValue - The object to be replaced.
newValue - The value to substitute.
 o replace
public int replace(int first,
                   int last,
                   Object oldValue,
                   Object newValue)
Replace all elements within a specified range that match a particular object with a new value and return the number of objects that were replaced.

Parameters:
first - The index of the first object to be considered.
last - The index of the last object to be considered.
oldValue - The object to be replaced.
newValue - The value to substitute.
Throws: IndexOutOfBoundsException
If either index is invalid.
 o contains
public boolean contains(Object object)
Return true if I contain a particular object using .equals()

Parameters:
object - The object in question.
 o indexOf
public int indexOf(Object object)
Return the index of the first object that matches a particular value, or -1 if the object is not found. Uses .equals() to find a match

Parameters:
object - The object to find.
Throws: ClassCastException
if objects are not Boolean
 o indexOf
public int indexOf(int first,
                   int last,
                   Object object)
Return an index positioned at the first object within a specified range that matches a particular object, or -1 if the object is not found.

Parameters:
first - The index of the first object to consider.
last - The index of the last object to consider.
object - The object to find.
Throws: IndexOutOfBoundsException
If either index is invalid.
Throws: ClassCastException
if objects are not Boolean
 o clear
public void clear()
Remove all of my objects. By default, this method throws an exception.

Throws: InvalidOperationException
Thrown by default.
 o add
public Object add(Object object)
Add an object to myself. By default, this method throws an exception.

Parameters:
object - The object to add.
Throws: InvalidOperationException
Thrown by default.
 o pushFront
public void pushFront(Object object)
Insert an object in front of my first element. By default, this method throws an exception.

Parameters:
object - The object to insert.
Throws: InvalidOperationException
Thrown by default.
 o popFront
public Object popFront()
Remove and return my first element. By default, this method throws an exception.

Throws: InvalidOperationException
Thrown by default.
 o pushBack
public void pushBack(Object object)
Add an object at my end. By default, this method throws an exception.

Parameters:
object - The object to add.
Throws: InvalidOperationException
Thrown by default.
 o popBack
public Object popBack()
Remove and return my last element. By default, this method throws an exception.

Throws: InvalidOperationException
Thrown by default.
 o remove
public int remove(Object object)
Remove all elements that match a specified object and return the number of objects that were removed. By default, this method throws an exception.

Parameters:
object - The object to remove.
Throws: InvalidOperationException
Thrown by default.
 o remove
public int remove(int first,
                  int last,
                  Object object)
Remove all elements within a specified range that match a particular object and return the number of objects that were removed. By default, this method throws an exception.

Parameters:
first - The index of the first object to remove.
last - The index of the last object to remove.
object - The object to remove.
Throws: IndexOutOfBoundsException
Thrown by default.

All Packages  Class Hierarchy  This Package  Previous  Next  Index