Rev 1306 |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
/*
* Copyright 2003-2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package pt.estgp.estgweb.utils;
import java.util.Collection;
import java.util.List;
import java.util.ListIterator;
/**
* Decorates another <code>List</code> to provide additional behaviour.
* <p>
* Methods are forwarded directly to the decorated list.
*
* @since Commons Collections 3.0
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:53:02 $
*
* @author Stephen Colebourne
*/
public abstract class AbstractListDecorator
extends AbstractCollectionDecorator
implements 5+0%2Fdocs%2Fapi+List">List {
/**
* Constructor only used in deserialization, do not use otherwise.
* @since Commons Collections 3.1
*/
protected AbstractListDecorator
() {
super();
}
/**
* Constructor that wraps (not copies).
*
* @param list the list to decorate, must not be null
* @throws IllegalArgumentException if list is null
*/
protected AbstractListDecorator
(5+0%2Fdocs%2Fapi+List">List list
) {
super(list
);
}
/**
* Gets the list being decorated.
*
* @return the decorated list
*/
protected 5+0%2Fdocs%2Fapi+List">List getList
() {
return (5+0%2Fdocs%2Fapi+List">List) getCollection
();
}
//-----------------------------------------------------------------------
public void add
(int index,
5+0%2Fdocs%2Fapi+Object">Object object
) {
getList
().
add(index, object
);
}
public boolean addAll
(int index,
1.5.0/docs/api/java/util/Collection.html">Collection coll
) {
return getList
().
addAll(index, coll
);
}
public 5+0%2Fdocs%2Fapi+Object">Object get
(int index
) {
return getList
().
get(index
);
}
public int indexOf
(5+0%2Fdocs%2Fapi+Object">Object object
) {
return getList
().
indexOf(object
);
}
public int lastIndexOf
(5+0%2Fdocs%2Fapi+Object">Object object
) {
return getList
().
lastIndexOf(object
);
}
public 1.5.0/docs/api/java/util/ListIterator.html">ListIterator listIterator
() {
return getList
().
listIterator();
}
public 1.5.0/docs/api/java/util/ListIterator.html">ListIterator listIterator
(int index
) {
return getList
().
listIterator(index
);
}
public 5+0%2Fdocs%2Fapi+Object">Object remove
(int index
) {
return getList
().
remove(index
);
}
public 5+0%2Fdocs%2Fapi+Object">Object set
(int index,
5+0%2Fdocs%2Fapi+Object">Object object
) {
return getList
().
set(index, object
);
}
public 5+0%2Fdocs%2Fapi+List">List subList
(int fromIndex,
int toIndex
) {
return getList
().
subList(fromIndex, toIndex
);
}
}