Code example for LinkedList

Methods: addLast

0
    public void addSectionFirst(int id, CharSequence caption, Adapter adapter) {
        sections.addFirst(new Section(id, caption, adapter));
    } 
 
    public void addSectionLast(int id, CharSequence caption, Adapter adapter) {
        sections.addLast(new Section(id, caption, adapter));
    } 
 
    public void removeSection(int id) {
        for (Section section : sections) {
            if (section.getId() == id) {
                sections.remove(section);
            } 
        } 
    } 
 
    /** 
     * Get current section and the given position. 
     * @author johan 
     * @param position the position 
     * @return the current section