All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class list.DListPosition

java.lang.Object
   |
   +----list.DListPosition

public class DListPosition
extends Object
implements Position

Constructor Index

 o DListPosition(DList)
Constructs a position that is at the front of dl.

Method Index

 o elementAt()
Returns the element at the current position.
 o insertAfter(Object)
Inserts elem just before the current position in the list.
 o insertBefore(Object)
Inserts elem just before the current position in the list.
 o isValidPosition()
Determines whether the current position is valid.
 o next()
Constructs a new ListPosition at the position after this one.
 o previous()
Constructs a new DListPosition at the position before this one.
 o remove()
Removes the element at this position in the DList.
 o setElementAt(Object)
Sets the element at the current position to elem.

Constructors

 o DListPosition
 public DListPosition(DList dl)
Constructs a position that is at the front of dl.

Methods

 o next
 public Position next() throws ListBoundsException
Constructs a new ListPosition at the position after this one. This position is not modified.

Throws: ListBoundsException
if the current position is not valid.
 o previous
 public Position previous() throws ListBoundsException
Constructs a new DListPosition at the position before this one. This position is not modified.

Throws: ListBoundsException
if the current position is not valid.
 o elementAt
 public Object elementAt() throws ListBoundsException
Returns the element at the current position.

Throws: ListBoundsException
if the current position is not valid.
 o setElementAt
 public void setElementAt(Object elem) throws ListBoundsException
Sets the element at the current position to elem.

Throws: ListBoundsException
if the current position is not valid.
 o insertBefore
 public void insertBefore(Object elem) throws ListBoundsException
Inserts elem just before the current position in the list.

Throws: ListBoundsException
if the current position is not valid.
 o insertAfter
 public void insertAfter(Object elem) throws ListBoundsException
Inserts elem just before the current position in the list.

Throws: ListBoundsException
if the current position is not valid.
 o remove
 public Object remove() throws ListBoundsException
Removes the element at this position in the DList. After performing a remove operation, the position becomes invalid.

Returns:
the element at the current position (before removal).
Throws: ListBoundsException
if the current position is not valid.
 o isValidPosition
 public boolean isValidPosition()
Determines whether the current position is valid.

Returns:
true if the current position is valid, false otherwise

All Packages  Class Hierarchy  This Package  Previous  Next  Index