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
-
at(int)
- Return the object at the specified index.
-
back()
- Return my last element.
-
clone()
-
-
contains(Object)
- Return true if I contain a particular object.
-
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.
-
front()
- Return my first element.
-
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.
-
indexOf(Object)
- Return the index of the first object that matches a particular value, or
-1 if the object is not found.
-
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.
-
put(int, Object)
- Set the object at a specified index.
-
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.
clone
public abstract Object clone()
- Overrides:
- clone in class Object
at
public abstract Object at(int index)
- Return the object at the specified index.
- Parameters:
- index - The index.
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.
back
public abstract Object back()
- Return my last element.
front
public abstract Object front()
- Return my first element.
pushFront
public abstract void pushFront(Object object)
- Insert an object in front of my first element.
- Parameters:
- object - The object to insert.
popFront
public abstract Object popFront()
- Remove and return my first element.
pushBack
public abstract void pushBack(Object object)
- Add an object at my end.
- Parameters:
- object - The object to add.
popBack
public abstract Object popBack()
- Remove and return my last element.
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.
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.
count
public abstract int count(Object object)
- Return the number of objects that match a specified object.
- Parameters:
- object - The object to count.
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.
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.
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.
contains
public abstract boolean contains(Object object)
- Return true if I contain a particular object.
- Parameters:
- object - The object in question.
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.
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