All Packages Class Hierarchy This Package Previous Next Index
Class list.DListPosition
java.lang.Object
|
+----list.DListPosition
- public class DListPosition
- extends Object
- implements Position
-
DListPosition(DList)
- Constructs a position that is at the front of dl.
-
elementAt()
- Returns the element at the current position.
-
insertAfter(Object)
- Inserts elem just before the current position in the list.
-
insertBefore(Object)
- Inserts elem just before the current position in the list.
-
isValidPosition()
- Determines whether the current position is valid.
-
next()
- Constructs a new ListPosition at the position after this one.
-
previous()
- Constructs a new DListPosition at the position before this one.
-
remove()
- Removes the element at this position in the DList.
-
setElementAt(Object)
- Sets the element at the current position to elem.
DListPosition
public DListPosition(DList dl)
- Constructs a position that is at the front of dl.
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.
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.
elementAt
public Object elementAt() throws ListBoundsException
- Returns the element at the current position.
- Throws: ListBoundsException
- if the current position is not valid.
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.
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.
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.
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.
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