Class SimpleLinkedList<E>
- java.lang.Object
-
- org.soulwing.prospecto.runtime.util.SimpleLinkedList<E>
-
- All Implemented Interfaces:
SimpleList<E>
- Direct Known Subclasses:
LinkedListObjectFactoryService
,LinkedListValueTypeConverterService
public class SimpleLinkedList<E> extends Object implements SimpleList<E>
ASimpleList
backed by aLinkedList
.- Author:
- Carl Harris
-
-
Constructor Summary
Constructors Constructor Description SimpleLinkedList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(E element)
Appends the given element to the end of the collection.void
prepend(E element)
Inserts the given element such that it becomes the first element in the collection.boolean
remove(E element)
Removes the given element from the collection.List<E>
toList()
Coerces this list into aList
.
-
-
-
Method Detail
-
append
public void append(E element)
Description copied from interface:SimpleList
Appends the given element to the end of the collection.- Specified by:
append
in interfaceSimpleList<E>
- Parameters:
element
- the element to append
-
prepend
public void prepend(E element)
Description copied from interface:SimpleList
Inserts the given element such that it becomes the first element in the collection.- Specified by:
prepend
in interfaceSimpleList<E>
- Parameters:
element
- the element to insert
-
remove
public boolean remove(E element)
Description copied from interface:SimpleList
Removes the given element from the collection.Any existing element identical to
element
is removed- Specified by:
remove
in interfaceSimpleList<E>
- Parameters:
element
- the element to remove- Returns:
true
if a element was removed
-
toList
public List<E> toList()
Description copied from interface:SimpleList
Coerces this list into aList
.The returned list may be manipulated to update this list.
- Specified by:
toList
in interfaceSimpleList<E>
- Returns:
- list of elements
-
-