package net.somethingdreadful.MAL.adapters;


import android.app.Activity;
import android.app.Fragment;

import java.util.ArrayList;

import lombok.Getter;
import lombok.Setter;

public class Fragments {
    private ArrayList<FragmentHolder> fragments = new ArrayList<>();
    Activity activity;

    Fragments(Activity activity) {
        this.activity = activity;
    }

    /**
     * Add fragments to the holder.
     *
     * @param fragment The fragment which should be added
     * @param name The fragment name res ID shown in the tabs
     */
    public void add(Fragment fragment, int name) {
        add(fragment, activity.getString(name));
    }

    /**
     * Add fragments to the holder.
     *
     * @param fragment The fragment which should be added
     * @param name The fragment String name shown in the tabs
     */
    public void add(Fragment fragment, String name) {
        fragments.add(new FragmentHolder(fragment, name));
    }

    public int getSize() {
        return fragments.size();
    }

    public Fragment getFragment(int position) {
        return fragments.get(position).getFragment();
    }

    public String getName(int position) {
        return fragments.get(position).getName();
    }

    public void clear() {
        fragments.clear();
    }

    public class FragmentHolder {
        @Getter
        @Setter
        private String name;
        @Getter
        @Setter
        private Fragment fragment;

        public FragmentHolder(Fragment fragment, String name) {
            this.fragment = fragment;
            this.name = name;
        }
    }
}

@@ -959,179 +959,623 @@
     
-public int getSize() %7B%0A        return fragments.size();%0A    %7D%0A%0A    public Fragment getFragment(int position) %7B%0A        return fragments.get(position).getFragment();%0A    %7D%0A
+/**%0A     * Get the amount of Fragments stored.%0A     *%0A     * @return Int the amount%0A     */%0A    public int getSize() %7B%0A        return fragments.size();%0A    %7D%0A%0A    /**%0A     * Get the fragment by the given position.%0A     *%0A     * @param position The fragment position%0A     * @return Fragment The fragment which was stored%0A     */%0A    public Fragment getFragment(int position) %7B%0A        return fragments.get(position).getFragment();%0A    %7D%0A%0A    /**%0A     * Get the fragment name by the given position.%0A     *%0A     * @param position The position of the fragment%0A     * @return String The name as shown in the tabs%0A     */
 %0A   
@@ -1662,32 +1662,77 @@
 tName();%0A    %7D%0A%0A
+    /**%0A     * Remove all fragments.%0A     */%0A
     public void 

Add Information about the fragments class