1 16 package org.apache.commons.collections.list; 17 18 import java.util.Collection ; 19 import java.util.List ; 20 import java.util.ListIterator ; 21 22 import org.apache.commons.collections.collection.AbstractCollectionDecorator; 23 24 34 public abstract class AbstractListDecorator extends AbstractCollectionDecorator implements List { 35 36 40 protected AbstractListDecorator() { 41 super(); 42 } 43 44 50 protected AbstractListDecorator(List list) { 51 super(list); 52 } 53 54 59 protected List getList() { 60 return (List ) getCollection(); 61 } 62 63 public void add(int index, Object object) { 65 getList().add(index, object); 66 } 67 68 public boolean addAll(int index, Collection coll) { 69 return getList().addAll(index, coll); 70 } 71 72 public Object get(int index) { 73 return getList().get(index); 74 } 75 76 public int indexOf(Object object) { 77 return getList().indexOf(object); 78 } 79 80 public int lastIndexOf(Object object) { 81 return getList().lastIndexOf(object); 82 } 83 84 public ListIterator listIterator() { 85 return getList().listIterator(); 86 } 87 88 public ListIterator listIterator(int index) { 89 return getList().listIterator(index); 90 } 91 92 public Object remove(int index) { 93 return getList().remove(index); 94 } 95 96 public Object set(int index, Object object) { 97 return getList().set(index, object); 98 } 99 100 public List subList(int fromIndex, int toIndex) { 101 return getList().subList(fromIndex, toIndex); 102 } 103 104 } 105 | Popular Tags |