Class DefaultLinkedList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- net.automatalib.common.smartcollection.AbstractSmartCollection<E>
-
- net.automatalib.common.smartcollection.AbstractLinkedList<E,DefaultLinkedListEntry<E>>
-
- net.automatalib.common.smartcollection.DefaultLinkedList<E>
-
- Type Parameters:
E
- element class.
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,SmartCollection<E>
,SmartSequence<E>
public class DefaultLinkedList<E> extends AbstractLinkedList<E,DefaultLinkedListEntry<E>>
A simple linked list implementation that allows storing arbitrary elements.
-
-
Constructor Summary
Constructors Constructor Description DefaultLinkedList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DefaultLinkedListEntry<E>
makeEntry(E element)
Creates (if necessary) aLinkedListEntry
for the given element.void
replace(ElementReference ref, E newElement)
Replaces the element referenced by the given reference with the specified element.-
Methods inherited from class net.automatalib.common.smartcollection.AbstractLinkedList
castRef, choose, chooseRef, clear, concat, get, getBack, getBackEntry, getBackReference, getFront, getFrontEntry, getFrontReference, insertAfter, insertAfterEntry, insertBefore, insertBeforeEntry, isEmpty, iterator, popBack, popBackEntry, popFront, popFrontEntry, pred, pushBack, pushBackEntry, pushFront, pushFrontEntry, referencedAdd, referenceIterator, remove, removeEntry, replaceEntry, size, succ, swap
-
Methods inherited from class net.automatalib.common.smartcollection.AbstractSmartCollection
add, addAll, addAll, deepClear, find, quickClear, references, remove
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
add, addAll, contains, containsAll, equals, hashCode, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface net.automatalib.common.smartcollection.SmartCollection
addAll, addAll, deepClear, find, quickClear, references, remove
-
-
-
-
Method Detail
-
replace
public void replace(ElementReference ref, E newElement)
Description copied from interface:SmartCollection
Replaces the element referenced by the given reference with the specified element.- Specified by:
replace
in interfaceSmartCollection<E>
- Overrides:
replace
in classAbstractLinkedList<E,DefaultLinkedListEntry<E>>
- Parameters:
ref
- the reference of the element to be replaced.newElement
- the replacement.
-
makeEntry
protected DefaultLinkedListEntry<E> makeEntry(E element)
Description copied from class:AbstractLinkedList
Creates (if necessary) aLinkedListEntry
for the given element. For intrusive linked lists, e.g., the argument itself is returned.- Specified by:
makeEntry
in classAbstractLinkedList<E,DefaultLinkedListEntry<E>>
- Parameters:
element
- the element for which to retrieve an entry.- Returns:
- the entry for the given element.
-
-