Java Collection to List toList(Collection lines)

Here you can find the source of toList(Collection lines)

Description

to List

License

Open Source License

Declaration

public static List<String> toList(Collection<String> lines) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

import java.util.Collection;

import java.util.List;

public class Main {
    public static List<String> toList(Collection<String> lines) {
        List<String> list = new ArrayList<String>(lines.size());
        for (String line : lines) {
            list.add(line);//from  w  ww. ja  v  a2  s .  com
        }
        return list;
    }
}

Related

  1. toList(Collection addresses, char separator)
  2. toList(Collection collection)
  3. toList(Collection collection)
  4. toList(Collection c)
  5. toList(Collection collection)
  6. toList(Collection c)
  7. toList(Collection c)
  8. toList(Collection collection)