Here you can find the source of strToAList(String strTokenize)
public static ArrayList strToAList(String strTokenize)
//package com.java2s; /*//from w ww .j av a2 s .c om * Copyright (C) 2015 University of Oregon * * You may distribute under the terms of either the GNU General Public * License or the Apache License, as specified in the LICENSE file. * * For more information, see the LICENSE file. */ import java.util.*; public class Main { /** * Takes a string and returns the array list for that string. */ public static ArrayList strToAList(String strTokenize) { return strToAList(strTokenize, true); } /** * Takes a string and returns the array list for that string. * @strTokenize string from which an arraylist should be made. * @strDelim delimeter string for the tokenizer. */ public static ArrayList strToAList(String strTokenize, String strDelim) { return strToAList(strTokenize, true, strDelim); } /** * Takes a string and returns the array list for that string. * @param strTokenize the string from which an arraylist should be made. * @param bAllowDups true if duplicates should be allowed in the arraylist. */ public static ArrayList strToAList(String strTokenize, boolean bAllowDups) { return strToAList(strTokenize, bAllowDups, " \t\n\r\f"); } /** * Takes a string and returns the array list for that string. * @param strTokenize the string from which an arraylist should be made. * @param bAllowDups true if duplicates should be allowed in the arraylist. * @param strDelim delimeter string for the tokenizer. */ public static ArrayList strToAList(String strTokenize, boolean bAllowDups, String strDelim) { ArrayList<String> aListValues = new ArrayList<String>(); String strValue; if (strTokenize == null) return aListValues; StringTokenizer strTokTmp = new StringTokenizer(strTokenize, strDelim); while (strTokTmp.hasMoreTokens()) { strValue = strTokTmp.nextToken(); if (strValue != null && strValue.trim().length() > 0) { if (bAllowDups || !aListValues.contains(strValue)) aListValues.add(strValue); } } return aListValues; } }