Java ArrayList Remove removeAlreadyParsedFolders(ArrayList listStrings, String pickup, String limit)

Here you can find the source of removeAlreadyParsedFolders(ArrayList listStrings, String pickup, String limit)

Description

remove Already Parsed Folders

License

Open Source License

Declaration

public static ArrayList<String> removeAlreadyParsedFolders(ArrayList<String> listStrings, String pickup,
            String limit) 

Method Source Code

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

import java.util.ArrayList;

public class Main {
    public static ArrayList<String> removeAlreadyParsedFolders(ArrayList<String> listStrings, String pickup,
            String limit) {/*from ww w  .ja  v a 2  s . co m*/
        int i;
        ArrayList<String> newList = listStrings;
        if (!pickup.isEmpty()) {
            for (i = 0; i < listStrings.size(); i++)
                if (listStrings.get(i).contains(pickup)) {
                    newList = new ArrayList<>(listStrings.subList(i, listStrings.size()));
                    break;
                }
        }

        if (!limit.isEmpty()) {
            for (i = 0; i < newList.size(); i++)
                if (newList.get(i).contains(limit)) {
                    newList = new ArrayList<>(newList.subList(0, i));
                    break;
                }
        }
        return newList;
    }
}

Related

  1. removeAdditionalRanges(String line, ArrayList indices, ArrayList newRanges)
  2. removeAllFromArrayList(ArrayList collection, Collection toRemove)
  3. removeAllListaProd(ArrayList lista)
  4. removeByReference(ArrayList list, T object)
  5. removeDuplicates(ArrayList al)
  6. removeDuplicates(ArrayList a)
  7. removeDuplicateWithOrder(List arrayList)