Java Utililty Methods List Create

List of utility methods to do List Create

Description

The list of methods to do List Create are organized into topic(s).

Method

StringcreateReleasesString(List tagsList)
create Releases String
if (tagsList.size() == 1) {
    return tagsList.remove(0);
} else {
    return tagsList.remove(0) + ", " + createReleasesString(tagsList);
double[]createResponse(String inputLabel, List imageLabels)
Creates network output vector (response) for the specified image data
double[] response = new double[imageLabels.size()];
int i = 0;
for (String imageLabel : imageLabels) {
    if (inputLabel.startsWith(imageLabel)) {
        response[i] = 1d;
    } else {
        response[i] = 0d;
    i++;
return response;
ListcreateSingletonList(T element)
create Singleton List
List<T> result = new ArrayList<T>();
result.add(element);
return result;
ListcreateSourceExtensionList(Map sourceExtensionMap)
Transforms the map of source extensions into a list of source extension sorted by the source class name of the source extension.
List<String> sourceClassNames = new ArrayList<String>(sourceExtensionMap.keySet());
Collections.sort(sourceClassNames);
List<E> list = new ArrayList<E>(sourceClassNames.size());
for (String sourceClassName : sourceClassNames) {
    E sourceExtension = sourceExtensionMap.get(sourceClassName);
    list.add(sourceExtension);
return list;
...
StringcreateSpaceDelimitedString(List stringList)
create Space Delimited String
StringBuffer buffer = new StringBuffer();
for (int index = 0; index < stringList.size(); index++) {
    String id = stringList.get(index);
    buffer.append(id);
    if (index < (stringList.size() - 1))
        buffer.append(' ');
return buffer.toString();
...
ArrayListcreateStringDummyList()
create String Dummy List
ArrayList<String> stringList = new ArrayList<>();
stringList.add("abc");
stringList.add("abc1");
stringList.add("abc2");
stringList.add("abc3");
stringList.add("abc4");
stringList.add("abc5");
return stringList;
...
StringcreateStringFromIntArray(List listOfNumbers)
create String From Int Array
String ret = ("[");
if (listOfNumbers != null) {
    for (int i = 0; i < listOfNumbers.size(); i++) {
        if (i != listOfNumbers.size() - 1) {
            ret += (listOfNumbers.get(i));
            ret += ", ";
        } else {
            ret += listOfNumbers.get(i);
...
StringcreateStringFromIntegerList(List lst)
Creates a comma separated string of integer values from a list of Integer
StringBuffer buf = new StringBuffer();
if (lst != null && !lst.isEmpty()) {
    Iterator<Integer> it = lst.iterator();
    while (it.hasNext()) {
        Integer day = it.next();
        buf.append(day.toString());
        if (it.hasNext()) {
            buf.append(",");
...
ArrayListCreateStringList(Collection values)
Converts a generic collection of objects into a list of String objects.
ArrayList<String> results = new ArrayList<String>();
for (Object value : values)
    results.add(String.valueOf(value));
return results;
ListcreateStringList(String csvString)
create String List
List<String> result;
if (csvString != null && !csvString.isEmpty()) {
    String[] schemaURLs = csvString.split(", ?");
    result = Arrays.asList(schemaURLs);
} else {
    result = new ArrayList<String>(0);
return result;
...