The list of methods to do ListIterator Usage are organized into topic(s).
Iterator
castIterator(final Iterator iterator)
Creates a iterator of the desired type based on the given iterator Warning This operation is not type safe.
return new Iterator<D>() {
private final Iterator<S> it = iterator;
@Override
public boolean hasNext() {
return it.hasNext();
@SuppressWarnings("unchecked")
@Override
...
ArrayList
clearNulls(Collection col)
clear Nulls
ArrayList<T> list = new ArrayList<T>(col.size());
for (T t : col) {
if (t != null) {
list.add(t);
return list;
String
createCommaSeparatedListOfFullTypeNames(ListIterator strIt) create Comma Separated List Of Full Type Names
if ((strIt == null) || !strIt.hasNext())
return null;
StringBuilder res = new StringBuilder(strIt.next());
while (strIt.hasNext()) {
res.append(", ");
res.append(strIt.next());
return res.toString();
...
int
differingDigits(final int lhs, final int rhs, final int base) differing Digits
final List<Integer> lhsDigits = digits(lhs, new ArrayList<Integer>(), base);
final List<Integer> rhsDigits = digits(rhs, new ArrayList<Integer>(), base);
if (lhsDigits.size() != rhsDigits.size())
return rhs;
int index = 0;
for (Iterator<Integer> rhsIt = rhsDigits.iterator(), lhsIt = lhsDigits.iterator(); rhsIt.hasNext(); index++)
if (rhsIt.next() != lhsIt.next())
return toInt(rhsDigits.subList(index, rhsDigits.size()), base);
...
ListIterator
emptyIterator()
empty Iterator
return (ListIterator<T>) EMPTY_ITERATOR;
List
filterStringList(final String prefix, final String infix, final String suffix, final List list) Filters the given list of strings, taking all elements that start with the given prefix, contain the given infix and end with the given suffix and returning them as a new list.
if ((list == null) || list.isEmpty()) {
return new ArrayList();
final List result = new ArrayList(list);
final ListIterator iter = result.listIterator();
while (iter.hasNext()) {
final String rowName = (String) iter.next();
if (prefix != null) {
...
int
findObject(Object item, ListIterator> iter) Finds an item by iterating through the specified iterator.
while (iter.hasNext()) {
Object o = iter.next();
if (item == null ? o == null : item.equals(o)) {
return iter.previousIndex();
return -1;
T
findPrevious(ListIterator iter) find Previous
T prev = null;
iter.previous();
if (iter.hasPrevious()) {
prev = iter.previous();
iter.next();
iter.next();
return prev;
...