All pastes #335222 Raw Edit

Untitled

public text v1 · immutable
·published 2007-02-01 05:05 UTC
rendered paste body
    /**
     * Inserts the given element at the beginning of this list.
     */
    public void addFirst(T element) {
        if(size==0) {
            first = new ListElement(element);
        } else {
            ListElement tmp = first; 
            first = new ListElement(element);
            first.next = tmp;
        }
        size++;
    }