insert (undone)

This commit is contained in:
Tim
2020-10-28 13:06:26 +01:00
parent da330ff62e
commit 197ad05b6d

View File

@@ -115,11 +115,13 @@ public class List<ContentType> {
* @param pContent das einzufuegende Objekt vom Typ ContentType
*/
public void insert( ContentType pContent ) {
// TODO: Implementiere insert() anhand der Beschreibung oben.
// Achte auf die korrekte Einhaltung des Verkettungsprinzips und
// das neue Element _vor_ dem Aktuellen eingefügt werden soll.
// Nutze bei der Implementierung die Hilfsmethode
// ListNode<ContentType> getPrevious()
if (hasAccess()) {
ListNode prev = getPrevious(current);
ListNode<> newNode = new ListNode<ContentType>(pContent);
current.setNextNode(prev.getNextNode());
} else {
append(pContent);
}
}
/**