Java ListIterator Usage createCommaSeparatedListOfFullTypeNames(ListIterator strIt)

Here you can find the source of createCommaSeparatedListOfFullTypeNames(ListIterator strIt)

Description

create Comma Separated List Of Full Type Names

License

Open Source License

Declaration

private static String createCommaSeparatedListOfFullTypeNames(ListIterator<String> strIt) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * <copyright>/*from w  w  w  .j  a va  2s. com*/
 *
 * Copyright (c) 2005, 2012 SAP AG and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Stefan Dimov - initial API, implementation and documentation
 *
 * </copyright>
 *
 *******************************************************************************/

import java.util.ListIterator;

public class Main {
    private static String createCommaSeparatedListOfFullTypeNames(ListIterator<String> strIt) {
        if ((strIt == null) || !strIt.hasNext())
            return null;
        StringBuilder res = new StringBuilder(strIt.next());
        while (strIt.hasNext()) {
            res.append(", "); //$NON-NLS-1$
            res.append(strIt.next());
        }
        return res.toString();
    }
}

Related

  1. castIterator(final Iterator iterator)
  2. clearNulls(Collection col)
  3. containsUsingListIteratorNext(List list, Integer value)
  4. differingDigits(final int lhs, final int rhs, final int base)
  5. emptyIterator()
  6. filterStringList(final String prefix, final String infix, final String suffix, final List list)
  7. findFirstIterator(List list, int fromIndex, int toIndex, T value, Comparator comparator)