Java Iterable to List toList(Iterable self)

Here you can find the source of toList(Iterable self)

Description

to List

License

Open Source License

Declaration

static <T> List<T> toList(Iterable<T> self) 

Method Source Code


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

import java.util.ArrayList;

import java.util.List;

public class Main {
    static <T> List<T> toList(Iterable<T> self) {
        List<T> answer = new ArrayList<T>();
        for (T t : self) {
            answer.add(t);/*from ww w  .  j  av a2s . c o m*/
        }
        return answer;
    }
}

Related

  1. toList(Iterable iter)
  2. toList(Iterable iterable)
  3. toList(Iterable iterable)
  4. toList(Iterable iterable)
  5. toList(Iterable iterable)