public void remove ( Element < T > element ) { if ( element . next == null ) { last = element . previous ; } else { element . next . previous = element . previous ; } if ( element . previous == null ) { first = element . next ; } else { element . previous . next = element . next ; } size -- ; element . clear ( ) ; available . push ( element ) ; }
Removes the element from the list and saves the element data structure for later reuse .