All pastes #335244 Raw Edit

Something

public text v1 · immutable
·published 2007-02-01 05:46 UTC
rendered paste body
    /**
     * Returns the element at the specified position in this list.
     * Returns <code>null</code> if <code>index</code> is out of bounds.
     */
    public T get(int index) {
        if(index<size) {
            ListElement traversalNode = first;  
            for(int i=0; i<index; i++) {
             traversalNode = traversalNode.next; 
             
            }
          T match = traversalNode.data;  
          return match;
        } else {
            return null;
        }
    }