Java List Remove removeEmptyTags(List tags)

Here you can find the source of removeEmptyTags(List tags)

Description

remove Empty Tags

License

Open Source License

Declaration

private static Collection<String> removeEmptyTags(List<String> tags) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2009 Alexander Koderman <ak[at]sernet[dot]de>.
 * This program is free software: you can redistribute it and/or 
 * modify it under the terms of the GNU Lesser General Public License 
 * as published by the Free Software Foundation, either version 3 
 * of the License, or (at your option) any later version.
 *     This program is distributed in the hope that it will be useful,    
 * but WITHOUT ANY WARRANTY; without even the implied warranty 
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 * See the GNU Lesser General Public License for more details.
 *     You should have received a copy of the GNU Lesser General Public 
 * License along with this program. /*from   w  ww . j  a  v  a  2  s .  c o  m*/
 * If not, see <http://www.gnu.org/licenses/>.
 * 
 * Contributors:
 *     Alexander Koderman <ak[at]sernet[dot]de> - initial API and implementation
 ******************************************************************************/

import java.util.ArrayList;

import java.util.Collection;

import java.util.List;

public class Main {
    private static Collection<String> removeEmptyTags(List<String> tags) {
        ArrayList<String> result = new ArrayList<String>(tags.size());
        for (String tag : tags) {
            if (!(tag.length() < 1 || tag.equals(" "))) { //$NON-NLS-1$
                result.add(tag);
            }
        }
        return result;
    }
}

Related

  1. removeEmptyLinesFromEnd(List list)
  2. removeEmptyLinesOnSides(List lines)
  3. removeEmptyLists(Map map)
  4. removeEmptyStringsFromList(List list)
  5. removeEmptyStringsInList(List list)
  6. removeEmptyValues(final List values)
  7. removeFrom(List col, int from)
  8. removeFrom(List list, T member)
  9. removeFromArray(String[] fieldList, String exludeElement)