org.apache.commons.cache.adt
Interface Listable

All Known Implementing Classes:
ListableBase, ListableObject, WListableBase, WListableObject

public interface Listable

A simple linked-listed inteface, supporting both singly and doubly linked lists.

Unlike LinkedList, this interface provides access to the list elements themselves, which may necessary for some uses.

Version:
$Id: Listable.java 155435 2005-02-26 13:17:27Z dirkv $
Author:
Rodney Waldhoff
See Also:
LinkedList

Method Summary
 Listable getNext()
          Return the Listable element following me, or null if I am the last element in the list.
 Listable getPrev()
          Return the Listable element preceeding me, or null if I am the last element in the list.
 boolean hasNext()
          Return true if there is a Listable element following me, false otherwise.
 boolean hasPrev()
          Return true if there is a Listable element preceeding me, false otherwise.
 void setNext(Listable next)
          Change my next element to next.
 void setPrev(Listable prev)
          Change my preceeding element to prev.
 

Method Detail

getNext

Listable getNext()
Return the Listable element following me, or null if I am the last element in the list.

Returns:
the Listable element following me, or null.

hasNext

boolean hasNext()
Return true if there is a Listable element following me, false otherwise.

Returns:
true if there is a Listable element following me, false otherwise.

setNext

void setNext(Listable next)
             throws UnsupportedOperationException
Change my next element to next. Note that this does not change the getPrev() value of next.

Parameters:
next - my new following sibling.
Throws:
UnsupportedOperationException - if I am a read-only list.

getPrev

Listable getPrev()
                 throws UnsupportedOperationException
Return the Listable element preceeding me, or null if I am the last element in the list.

Returns:
the Listable element preceeding me, or null.
Throws:
UnsupportedOperationException - if I am a singly-linked list.

hasPrev

boolean hasPrev()
                throws UnsupportedOperationException
Return true if there is a Listable element preceeding me, false otherwise.

Returns:
true if there is a Listable element preceeding me, false otherwise.
Throws:
UnsupportedOperationException - if I am a singly-linked list.

setPrev

void setPrev(Listable prev)
             throws UnsupportedOperationException
Change my preceeding element to prev. Note that this does not change the getNext() value of prev.

Parameters:
prev - my new preceeding sibling.
Throws:
UnsupportedOperationException - if I am a singly-linked or read-only list.


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.