mirror of
https://github.com/twiglet/cs2j.git
synced 2025-01-18 13:15:17 +01:00
CSList must imolement the List interface
This commit is contained in:
parent
3ef2738687
commit
c610bfe980
@ -24,17 +24,19 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.ListIterator;
|
||||||
|
|
||||||
import CS2JNet.JavaSupport.Collections.Generic.EnumeratorSupport;
|
import CS2JNet.JavaSupport.Collections.Generic.EnumeratorSupport;
|
||||||
import CS2JNet.System.ArgumentException;
|
import CS2JNet.System.ArgumentException;
|
||||||
import CS2JNet.System.ArgumentNullException;
|
import CS2JNet.System.ArgumentNullException;
|
||||||
import CS2JNet.System.ArgumentOutOfRangeException;
|
import CS2JNet.System.ArgumentOutOfRangeException;
|
||||||
|
import CS2JNet.System.NotImplementedException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author keving
|
* @author keving
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class CSList<T> implements ICollection<T>, IEnumerable<T>, Collection<T> {
|
public class CSList<T> implements ICollection<T>, IEnumerable<T>, Collection<T>, List<T> {
|
||||||
|
|
||||||
private List<T> myList = null;
|
private List<T> myList = null;
|
||||||
|
|
||||||
@ -145,5 +147,45 @@ public class CSList<T> implements ICollection<T>, IEnumerable<T>, Collection<T>
|
|||||||
arr[idx+i] = myList.get(idx);
|
arr[idx+i] = myList.get(idx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void add(int arg0, T arg1) {
|
||||||
|
myList.add(arg0,arg1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean addAll(int arg0, Collection<? extends T> arg1) {
|
||||||
|
return myList.addAll(arg0, arg1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T get(int arg0) {
|
||||||
|
return myList.get(arg0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int indexOf(Object arg0) {
|
||||||
|
return myList.indexOf(arg0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int lastIndexOf(Object arg0) {
|
||||||
|
return myList.lastIndexOf(arg0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListIterator<T> listIterator() {
|
||||||
|
return myList.listIterator();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListIterator<T> listIterator(int arg0) {
|
||||||
|
return myList.listIterator(arg0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T remove(int arg0) {
|
||||||
|
return myList.remove(arg0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T set(int arg0, T arg1) {
|
||||||
|
return myList.set(arg0, arg1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> subList(int arg0, int arg1) {
|
||||||
|
return myList.subList(arg0, arg1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.ListIterator;
|
||||||
|
|
||||||
import CS2JNet.JavaSupport.Collections.Generic.LCC.EnumeratorSupport;
|
import CS2JNet.JavaSupport.Collections.Generic.LCC.EnumeratorSupport;
|
||||||
import CS2JNet.System.ArgumentException;
|
import CS2JNet.System.ArgumentException;
|
||||||
@ -34,7 +35,7 @@ import CS2JNet.System.ArgumentOutOfRangeException;
|
|||||||
* @author keving
|
* @author keving
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class CSList<T> implements ICollection<T>, IEnumerable<T>, Collection<T> {
|
public class CSList<T> implements ICollection<T>, IEnumerable<T>, Collection<T>, List<T> {
|
||||||
|
|
||||||
private List<T> myList = null;
|
private List<T> myList = null;
|
||||||
|
|
||||||
@ -172,4 +173,44 @@ public class CSList<T> implements ICollection<T>, IEnumerable<T>, Collection<T>
|
|||||||
CopyTo(arr, i);
|
CopyTo(arr, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void add(int arg0, T arg1) {
|
||||||
|
myList.add(arg0,arg1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean addAll(int arg0, Collection<? extends T> arg1) {
|
||||||
|
return myList.addAll(arg0, arg1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T get(int arg0) {
|
||||||
|
return myList.get(arg0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int indexOf(Object arg0) {
|
||||||
|
return myList.indexOf(arg0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int lastIndexOf(Object arg0) {
|
||||||
|
return myList.lastIndexOf(arg0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListIterator<T> listIterator() {
|
||||||
|
return myList.listIterator();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListIterator<T> listIterator(int arg0) {
|
||||||
|
return myList.listIterator(arg0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T remove(int arg0) {
|
||||||
|
return myList.remove(arg0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T set(int arg0, T arg1) {
|
||||||
|
return myList.set(arg0, arg1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> subList(int arg0, int arg1) {
|
||||||
|
return myList.subList(arg0, arg1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user