Java String Split splitter(List list, final int L)

Here you can find the source of splitter(List list, final int L)

Description

splitter

License

Apache License

Declaration

public static <T> List<List<T>> splitter(List<T> list, final int L) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static <T> List<List<T>> splitter(List<T> list, final int L) {
        List<List<T>> parts = new ArrayList<List<T>>();
        final int N = list.size();
        for (int i = 0; i < N; i += L) {
            parts.add(list.subList(i, Math.min(N, i + L)));
        }/*from   w w w .j  a v  a  2  s  . co m*/
        return parts;
    }
}

Related

  1. splitStruct(String struct)
  2. splitSubstring(String str, String substr)
  3. splitTags(final String tagsString)
  4. splitTags(String rawTags)
  5. splitTemplateName(String templateName)
  6. splitTerms(String queryString)
  7. splitText(String text)
  8. splitToInteger(String str)
  9. splitTokens(final String targets)