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
-
ArrayAdapter()
-
-
add(Object)
- Add an object to myself.
-
back()
- Return my last element.
-
clear()
- Remove all of my objects.
-
clone()
-
-
contains(Object)
- Return true if I contain a particular object using .equals()
-
count(int, int, Object)
- Return the number of objects within a specified range of that match a
particular value.
-
count(Object)
- Return the number of objects that match a specified object.
-
equals(Object)
-
-
front()
- Return my first element.
-
hashCode()
- Return my hash code for support of hashing containers
-
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.
-
indexOf(Object)
- Return the index of the first object that matches a particular value, or
-1 if the object is not found.
-
isEmpty()
- Return true if I contain no objects.
-
popBack()
- Remove and return my last element.
-
popFront()
- Remove and return my first element.
-
pushBack(Object)
- Add an object at my end.
-
pushFront(Object)
- Insert an object in front of my first element.
-
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.
-
remove(Object)
- Remove all elements that match a specified object and return the number of
objects that were removed.
-
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.
-
replace(Object, Object)
- Replace all elements that match a particular object with a new value and return
the number of objects that were replaced.
ArrayAdapter
public ArrayAdapter()
clone
public Object clone()
- Overrides:
- clone in class Object
equals
public boolean equals(Object object)
- Overrides:
- equals in class Object
hashCode
public int hashCode()
- Return my hash code for support of hashing containers
- Overrides:
- hashCode in class Object
isEmpty
public boolean isEmpty()
- Return true if I contain no objects.
back
public Object back()
- Return my last element.
front
public Object front()
- Return my first element.
count
public int count(Object object)
- Return the number of objects that match a specified object.
- Parameters:
- object - The object to count.
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.
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.
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.
contains
public boolean contains(Object object)
- Return true if I contain a particular object using .equals()
- Parameters:
- object - The object in question.
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
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
clear
public void clear()
- Remove all of my objects. By default, this method throws an exception.
- Throws:
InvalidOperationException
- Thrown by default.
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.
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.
popFront
public Object popFront()
- Remove and return my first element. By default, this method throws an exception.
- Throws:
InvalidOperationException
- Thrown by default.
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.
popBack
public Object popBack()
- Remove and return my last element. By default, this method throws an exception.
- Throws:
InvalidOperationException
- Thrown by default.
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.
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