/**
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 *
 * Copyright (C)
 * <a href="http://www.inab.org">Spanish National Institute of Bioinformatics (INB)</a>
 * <a href="http://www.bsc.es">Barcelona Supercomputing Center (BSC)</a>
 * <a href="http://inb.bsc.es">Computational Node 6</a>
 */

package org.inb.biomoby.shared.message;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author Dmitry Repchevsky
 */

@XmlRootElement(name="Collection")
public class MobyCollection<MobySimple> extends MobyDataElement implements List<MobySimple>, Serializable
{
    private List<MobySimple> list;

    public MobyCollection()
    {
        list = new ArrayList<MobySimple>();
    }

    @XmlElementRef(type=org.inb.biomoby.shared.message.MobySimple.class)
    List<MobySimple> getList()
    {
        return list;
    }
    
    public int size()
    {
        return list.size();
    }

    public boolean isEmpty()
    {
        return list.isEmpty();
    }

    public boolean contains(Object o)
    {
        return list.isEmpty();
    }

    public Iterator<MobySimple> iterator()
    {
        return list.iterator();
    }

    public Object[] toArray()
    {
        return list.toArray();
    }

    public <T> T[] toArray(T[] a)
    {
        return list.toArray(a);
    }

    public boolean add(MobySimple mobySimple)
    {
        return list.add(mobySimple);
    }

    public boolean remove(Object o)
    {
        return list.remove(o);
    }

    public boolean containsAll(Collection<?> c)
    {
        return list.contains(c);
    }

    public boolean addAll(Collection<? extends MobySimple> c)
    {
        return list.addAll(c);
    }

    public boolean addAll(int index, Collection<? extends MobySimple> c)
    {
        return list.addAll(index, c);
    }

    public boolean removeAll(Collection<?> c)
    {
        return list.removeAll(c);
    }

    public boolean retainAll(Collection<?> c)
    {
        return list.retainAll(c);
    }

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

    public MobySimple get(int index)
    {
        return list.get(index);
    }

    public MobySimple set(int index, MobySimple mobySimple)
    {
        return list.set(index, mobySimple);
    }

    public void add(int index, MobySimple mobySimple)
    {
        list.add(index, mobySimple);
    }

    public MobySimple remove(int index)
    {
        return list.remove(index);
    }

    public int indexOf(Object o)
    {
        return list.indexOf(o);
    }

    public int lastIndexOf(Object o)
    {
        return list.lastIndexOf(o);
    }

    public ListIterator<MobySimple> listIterator()
    {
        return list.listIterator();
    }

    public ListIterator<MobySimple> listIterator(int index)
    {
        return list.listIterator(index);
    }

    public List<MobySimple> subList(int fromIndex, int toIndex)
    {
        return list.subList(fromIndex, toIndex);
    }
}
