|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| ListWrapper.java | - | 25% | 20% | 22.6% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* Joey and its relative products are published under the terms
|
|
| 3 |
* of the Apache Software License.
|
|
| 4 |
*/
|
|
| 5 |
package org.asyrinx.brownie.core.collection.wrapper;
|
|
| 6 |
|
|
| 7 |
import java.util.ArrayList;
|
|
| 8 |
import java.util.Collection;
|
|
| 9 |
import java.util.List;
|
|
| 10 |
import java.util.ListIterator;
|
|
| 11 |
|
|
| 12 |
/**
|
|
| 13 |
*
|
|
| 14 |
* @author akima
|
|
| 15 |
*/
|
|
| 16 |
public class ListWrapper extends CollectionWrapper implements List { |
|
| 17 |
|
|
| 18 |
/**
|
|
| 19 |
* Constructor for ArrayListQueue.
|
|
| 20 |
*
|
|
| 21 |
* @param initialCapacity
|
|
| 22 |
*/
|
|
| 23 | 0 |
public ListWrapper(int initialCapacity) { |
| 24 | 0 |
this(new ArrayList(initialCapacity)); |
| 25 |
} |
|
| 26 |
|
|
| 27 |
/**
|
|
| 28 |
* Constructor for ArrayListQueue.
|
|
| 29 |
*/
|
|
| 30 | 1 |
public ListWrapper() {
|
| 31 | 1 |
this(new ArrayList()); |
| 32 |
} |
|
| 33 |
|
|
| 34 |
/**
|
|
| 35 |
* Constructor for ArrayListQueue.
|
|
| 36 |
*
|
|
| 37 |
* @param c
|
|
| 38 |
*/
|
|
| 39 | 0 |
public ListWrapper(Collection c) {
|
| 40 | 0 |
this(new ArrayList(c)); |
| 41 |
} |
|
| 42 |
|
|
| 43 | 1 |
public ListWrapper(List list) {
|
| 44 | 1 |
super(list);
|
| 45 | 1 |
this.list = list;
|
| 46 |
} |
|
| 47 |
|
|
| 48 |
protected final List list;
|
|
| 49 |
|
|
| 50 |
/**
|
|
| 51 |
* @see java.util.List#add(int, Object)
|
|
| 52 |
*/
|
|
| 53 | 0 |
public void add(int index, Object element) { |
| 54 | 0 |
list.add(index, element); |
| 55 |
} |
|
| 56 |
|
|
| 57 |
/**
|
|
| 58 |
* @see java.util.List#addAll(int, Collection)
|
|
| 59 |
*/
|
|
| 60 | 0 |
public boolean addAll(int index, Collection c) { |
| 61 | 0 |
return list.addAll(index, c);
|
| 62 |
} |
|
| 63 |
|
|
| 64 |
/**
|
|
| 65 |
* @see java.util.List#get(int)
|
|
| 66 |
*/
|
|
| 67 | 9 |
public Object get(int index) { |
| 68 | 9 |
return list.get(index);
|
| 69 |
} |
|
| 70 |
|
|
| 71 |
/**
|
|
| 72 |
* @see java.util.List#indexOf(Object)
|
|
| 73 |
*/
|
|
| 74 | 0 |
public int indexOf(Object o) { |
| 75 | 0 |
return list.indexOf(o);
|
| 76 |
} |
|
| 77 |
|
|
| 78 |
/**
|
|
| 79 |
* @see java.util.List#lastIndexOf(Object)
|
|
| 80 |
*/
|
|
| 81 | 0 |
public int lastIndexOf(Object o) { |
| 82 | 0 |
return list.lastIndexOf(o);
|
| 83 |
} |
|
| 84 |
|
|
| 85 |
/**
|
|
| 86 |
* @see java.util.List#listIterator()
|
|
| 87 |
*/
|
|
| 88 | 0 |
public ListIterator listIterator() {
|
| 89 | 0 |
return list.listIterator();
|
| 90 |
} |
|
| 91 |
|
|
| 92 |
/**
|
|
| 93 |
* @see java.util.List#listIterator(int)
|
|
| 94 |
*/
|
|
| 95 | 0 |
public ListIterator listIterator(int index) { |
| 96 | 0 |
return list.listIterator(index);
|
| 97 |
} |
|
| 98 |
|
|
| 99 |
/**
|
|
| 100 |
* @see java.util.List#remove(int)
|
|
| 101 |
*/
|
|
| 102 | 0 |
public Object remove(int index) { |
| 103 | 0 |
return list.remove(index);
|
| 104 |
} |
|
| 105 |
|
|
| 106 |
/**
|
|
| 107 |
* @see java.util.List#set(int, Object)
|
|
| 108 |
*/
|
|
| 109 | 0 |
public Object set(int index, Object element) { |
| 110 | 0 |
return list.set(index, element);
|
| 111 |
} |
|
| 112 |
|
|
| 113 |
/**
|
|
| 114 |
* @see java.util.List#subList(int, int)
|
|
| 115 |
*/
|
|
| 116 | 0 |
public List subList(int fromIndex, int toIndex) { |
| 117 | 0 |
return list.subList(fromIndex, toIndex);
|
| 118 |
} |
|
| 119 |
|
|
| 120 |
/**
|
|
| 121 |
* @see java.lang.Object#toString()
|
|
| 122 |
*/
|
|
| 123 | 0 |
public String toString() {
|
| 124 | 0 |
return list.toString();
|
| 125 |
} |
|
| 126 |
|
|
| 127 |
} |
|
||||||||||