org.apache.jcs.utils.struct
Class SingleLinkedList

java.lang.Object
  extended by org.apache.jcs.utils.struct.SingleLinkedList

public class SingleLinkedList
extends java.lang.Object

This is an basic thread safe single linked list. It provides very limited functionality. It is small and fast.

Author:
Aaron Smuts

Constructor Summary
SingleLinkedList()
           
 
Method Summary
 void addLast(java.lang.Object payload)
          Adds an item to the end of the list.
 void clear()
          Removes everything.
 int size()
          Returns the number of elements in the list.
 java.lang.Object takeFirst()
          Takes the first item off the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleLinkedList

public SingleLinkedList()
Method Detail

takeFirst

public java.lang.Object takeFirst()
Takes the first item off the list.

Returns:
null if the list is empty.

addLast

public void addLast(java.lang.Object payload)
Adds an item to the end of the list.

Parameters:
payload -

clear

public void clear()
Removes everything.


size

public int size()
Returns the number of elements in the list.

Returns:
number of items in the list.


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.