Informatik (Fach) / DAP1 (Lektion)
public void remove( Object o ) { Element candidate = first; Element nextCandidate; while ( candidate != null ) { nextCandidate = candidate.getNext(); if ( ( o == null && candidate.getContent() == null ) || ( o != null && o.equals( candidate.getContent() ) ) ) { if ( candidate == first && candidate == last ) { first = last = null; } else if ( candidate == first ) { first = candidate.getNext(); first.disconnectPrevious(); } else if ( candidate == last ) { last = last.getPrevious(); last.disconnectNext(); } else { candidate.getPrevious().connectAsNext( candidate.getNext() ); } size--; } candidate = nextCandidate; } }
Diese Karteikarte wurde von checko erstellt.