Java Vector from String unique(Vector list)

Here you can find the source of unique(Vector list)

Description

unique

License

BSD License

Declaration

public static Vector<String> unique(Vector<String> list) 

Method Source Code

//package com.java2s;
/*L/*from   w ww . jav a2s.  c  o m*/
 * Copyright Northrop Grumman Information Technology.
 *
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/nci-value-set-editor/LICENSE.txt for details.
 */

import java.util.*;

public class Main {
    public static Vector<String> unique(Vector<String> list) {
        Vector<String> newList = new Vector<String>();
        Iterator<String> iterator = list.iterator();
        while (iterator.hasNext()) {
            String text = iterator.next();
            if (!newList.contains(text))
                newList.add(text);
        }
        return newList;
    }
}

Related

  1. reverseVector(Vector rc)
  2. string2Vector(String s, String delimiter)
  3. stringArrayToVector(String[] array)
  4. stringToVector(String[] arr)
  5. stringVector(String input, String sepChars)
  6. vectorContainsIgnoreCaseFirstLetter(Vector v, String value)
  7. vectorString(String splitStr, String delim)