/**
 * 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.XmlRootElement;

/**
 * @author Dmitry Repchevsky
 */

@XmlRootElement
public class MobyExceptions extends Exception implements List<MobyException>, Serializable
{
    private ArrayList<MobyException> exceptions;

    public MobyExceptions()
    {
        exceptions = new ArrayList<MobyException>();
    }
    
    public int size()
    {
        return exceptions.size();
    }

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

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

    public Iterator<MobyException> iterator()
    {
        return exceptions.iterator();
    }

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

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

    public boolean add(MobyException e)
    {
        return exceptions.add(e);
    }

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

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

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

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

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

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

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

    public MobyException get(int index)
    {
        return exceptions.get(index);
    }

    public MobyException set(int index, MobyException element)
    {
        return exceptions.set(index, element);
    }

    public void add(int index, MobyException element)
    {
        exceptions.add(index, element);
    }

    public MobyException remove(int index)
    {
        return exceptions.remove(index);
    }

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

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

    public ListIterator<MobyException> listIterator()
    {
        return exceptions.listIterator();
    }

    public ListIterator<MobyException> listIterator(int index)
    {
        return exceptions.listIterator(index);
    }

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

}
