Interface SmartSequence<E>
- Type Parameters:
E- element class.
- All Superinterfaces:
Collection<E>,Iterable<E>,SmartCollection<E>
- All Known Implementing Classes:
AbstractLinkedList,DefaultLinkedList,IntrusiveLinkedList
Sequence interface. A sequence is a collection where elements are stored in a specific order, and elements can be
inserted in between.
-
Method Summary
Modifier and TypeMethodDescriptioninsertAfter(E element, ElementReference ref) Inserts the given element after the element referenced by the specified reference.insertBefore(E element, ElementReference ref) Inserts the given element before the element referenced by the specified reference.pred(ElementReference ref) Retrieves the reference to the preceding element, ornullif the given reference references the first element in the list.succ(ElementReference ref) Retrieves the reference to the succeeding element, ornullif the given reference references the last element in the list.Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArrayMethods inherited from interface net.automatalib.common.smartcollection.SmartCollection
addAll, addAll, choose, chooseRef, deepClear, find, get, quickClear, referencedAdd, referenceIterator, references, remove, remove, replace
-
Method Details
-
pred
Retrieves the reference to the preceding element, ornullif the given reference references the first element in the list.- Parameters:
ref- the reference- Returns:
- the reference to the preceding element
-
succ
Retrieves the reference to the succeeding element, ornullif the given reference references the last element in the list.- Parameters:
ref- the reference- Returns:
- the reference to the succeeding element
-
insertBefore
Inserts the given element before the element referenced by the specified reference.- Parameters:
element- the element to be added.ref- reference to the element before which the new element is to be inserted.- Returns:
- reference to the newly added element.
-
insertAfter
Inserts the given element after the element referenced by the specified reference.- Parameters:
element- the element to be added.ref- reference to the element after which the new element is to be inserted.- Returns:
- reference to the newly added element.
-