org.jboss.as.server.deployment.AttachmentList Maven / Gradle / Ivy
The newest version!
/*
* JBoss, Home of Professional Open Source.
* Copyright 2010, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.server.deployment;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.RandomAccess;
/**
* @author David M. Lloyd
*/
public final class AttachmentList implements List, RandomAccess {
private final Class valueClass;
private final List delegate;
public AttachmentList(final int initialCapacity, final Class valueClass) {
delegate = Collections.checkedList(new ArrayList(initialCapacity), valueClass);
this.valueClass = valueClass;
}
public AttachmentList(final Class valueClass) {
delegate = Collections.checkedList(new ArrayList(), valueClass);
this.valueClass = valueClass;
}
public AttachmentList(final Collection c, final Class valueClass) {
delegate = Collections.checkedList(new ArrayList(c.size()), valueClass);
delegate.addAll(c);
this.valueClass = valueClass;
}
public Class getValueClass() {
return valueClass;
}
public int size() {
return delegate.size();
}
public boolean isEmpty() {
return delegate.isEmpty();
}
public boolean contains(final Object o) {
return delegate.contains(o);
}
public Iterator iterator() {
return delegate.iterator();
}
public Object[] toArray() {
return delegate.toArray();
}
public T[] toArray(final T[] a) {
return delegate.toArray(a);
}
public boolean add(final T t) {
return delegate.add(t);
}
public boolean remove(final Object o) {
return delegate.remove(o);
}
public boolean containsAll(final Collection c) {
return delegate.containsAll(c);
}
public boolean addAll(final Collection c) {
return delegate.addAll(c);
}
public boolean addAll(final int index, final Collection c) {
return delegate.addAll(index, c);
}
public boolean removeAll(final Collection c) {
return delegate.removeAll(c);
}
public boolean retainAll(final Collection c) {
return delegate.retainAll(c);
}
public void clear() {
delegate.clear();
}
public boolean equals(final Object o) {
return delegate.equals(o);
}
public int hashCode() {
return delegate.hashCode();
}
public T get(final int index) {
return delegate.get(index);
}
public T set(final int index, final T element) {
return delegate.set(index, element);
}
public void add(final int index, final T element) {
delegate.add(index, element);
}
public T remove(final int index) {
return delegate.remove(index);
}
public int indexOf(final Object o) {
return delegate.indexOf(o);
}
public int lastIndexOf(final Object o) {
return delegate.lastIndexOf(o);
}
public ListIterator listIterator() {
return delegate.listIterator();
}
public ListIterator listIterator(final int index) {
return delegate.listIterator(index);
}
public List subList(final int fromIndex, final int toIndex) {
return delegate.subList(fromIndex, toIndex);
}
}