All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Interface jgl.Sequence

public interface Sequence
extends Container
Sequence is the interface that is implemented by all Java toolkit containers that are sequences of objects.

Version:
JOS-FileSystem 4 Preview (25-Mar-98)
Author:
ObjectSpace, Inc.
See Also:
jgl.Array, jgl.Deque, jgl.DList, jgl.SList

Method Index

 o at(int)
Return the object at the specified index.
 o back()
Return my last element.
 o clone()
 o contains(Object)
Return true if I contain a particular object.
 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 front()
Return my first element.
 o indexOf(int, int, Object)
Return an iterator 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 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 put(int, Object)
Set the object at a specified index.
 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.

Methods

 o clone
public abstract Object clone()
Overrides:
clone in class Object
 o at
public abstract Object at(int index)
Return the object at the specified index.

Parameters:
index - The index.
 o put
public abstract void put(int index,
                         Object object)
Set the object at a specified index.

Parameters:
index - The index.
object - The object to place at the specified index.
 o back
public abstract Object back()
Return my last element.

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

 o pushFront
public abstract void pushFront(Object object)
Insert an object in front of my first element.

Parameters:
object - The object to insert.
 o popFront
public abstract Object popFront()
Remove and return my first element.

 o pushBack
public abstract void pushBack(Object object)
Add an object at my end.

Parameters:
object - The object to add.
 o popBack
public abstract Object popBack()
Remove and return my last element.

 o remove
public abstract int remove(Object object)
Remove all elements that match a specified object and return the number of objects that were removed.

Parameters:
object - The object to remove.
 o remove
public abstract 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.

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
If either index is invalid.
 o count
public abstract int count(Object object)
Return the number of objects that match a specified object.

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

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 abstract 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 abstract 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 abstract boolean contains(Object object)
Return true if I contain a particular object.

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

Parameters:
object - The object to find.
 o indexOf
public abstract int indexOf(int first,
                            int last,
                            Object object)
Return an iterator 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.

All Packages  Class Hierarchy  This Package  Previous  Next  Index