org.objectweb.dream.queue
Class ListAddRemoveFirstLastImpl

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.queue.ListAddRemoveFirstLastImpl
All Implemented Interfaces:
BindingController, LifeCycleController, List, ListAddFirstLast, ListRemoveFirstLast, Loggable

public class ListAddRemoveFirstLastImpl
extends AbstractComponent
implements List, ListAddFirstLast, ListRemoveFirstLast

The ListAddRemoveFirstLastFastImpl class implements the List, ListAddFirstLast, and ListRemoveFirstLastinterfaces using a LinkedList.

Note: None of the methods in this linked list are synchronized.


Field Summary
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, firstStart, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.dream.queue.List
ITF_NAME
 
Fields inherited from interface org.objectweb.dream.queue.ListAddFirstLast
ITF_NAME
 
Fields inherited from interface org.objectweb.dream.queue.ListRemoveFirstLast
ITF_NAME
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
ListAddRemoveFirstLastImpl()
           
 
Method Summary
 void add(Object o)
          Adds the specified element to the list.
 void addFirst(Object o)
          Inserts the given element at the beginning of this list.
 void addLast(Object o)
          Appends the given element to the end of this list.
 Object getFirst()
          Returns the first element in this list.
 Object getLast()
          Returns the last element in this list.
 boolean isEmpty()
          Returns true if the list is empty.
 String[] listFc()
           
 Object remove()
          Removes an object from the list.
 Object removeFirst()
          Removes and returns the first element from this list.
 Object removeLast()
          Removes and returns the last element from this list.
 
Methods inherited from class org.objectweb.dream.AbstractComponent
beforeFirstStart, bindFc, getFcState, initComponent, lookupFc, setLogger, startFc, stopFc, unbindFc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListAddRemoveFirstLastImpl

public ListAddRemoveFirstLastImpl()
Method Detail

add

public void add(Object o)
Description copied from interface: List
Adds the specified element to the list.

Specified by:
add in interface List
Parameters:
o - element to be added to this list.
See Also:
List.add(Object)

remove

public Object remove()
Description copied from interface: List
Removes an object from the list.

Specified by:
remove in interface List
Returns:
the removed object, or null if the list is empty.
See Also:
List.remove()

isEmpty

public boolean isEmpty()
Description copied from interface: List
Returns true if the list is empty.

Specified by:
isEmpty in interface List
Returns:
true if the list is empty.
See Also:
List.isEmpty()

addLast

public void addLast(Object o)
Description copied from interface: ListAddFirstLast
Appends the given element to the end of this list.

Specified by:
addLast in interface ListAddFirstLast
Parameters:
o - the element to be inserted at the end of this list.
See Also:
ListAddFirstLast.addLast(Object)

addFirst

public void addFirst(Object o)
Description copied from interface: ListAddFirstLast
Inserts the given element at the beginning of this list.

Specified by:
addFirst in interface ListAddFirstLast
Parameters:
o - the element to be inserted at the beginning of this list.
See Also:
ListAddFirstLast.addFirst(Object)

getLast

public Object getLast()
Description copied from interface: ListRemoveFirstLast
Returns the last element in this list.

Specified by:
getLast in interface ListRemoveFirstLast
Returns:
the last element in this list.
See Also:
ListRemoveFirstLast.getLast()

removeLast

public Object removeLast()
Description copied from interface: ListRemoveFirstLast
Removes and returns the last element from this list.

Specified by:
removeLast in interface ListRemoveFirstLast
Returns:
the last element from this list.
See Also:
ListRemoveFirstLast.removeLast()

getFirst

public Object getFirst()
Description copied from interface: ListRemoveFirstLast
Returns the first element in this list.

Specified by:
getFirst in interface ListRemoveFirstLast
Returns:
the first element in this list.
See Also:
ListRemoveFirstLast.getFirst()

removeFirst

public Object removeFirst()
Description copied from interface: ListRemoveFirstLast
Removes and returns the first element from this list.

Specified by:
removeFirst in interface ListRemoveFirstLast
Returns:
the first element from this list.
See Also:
ListRemoveFirstLast.removeFirst()

listFc

public String[] listFc()
Specified by:
listFc in interface BindingController
See Also:
BindingController.listFc()


Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.