Java List Sub List getIndicesOfItems(List superList, List sublist)

Here you can find the source of getIndicesOfItems(List superList, List sublist)

Description

get Indices Of Items

License

Open Source License

Declaration

public static List<Integer> getIndicesOfItems(List superList, List sublist) 

Method Source Code

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

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static List<Integer> getIndicesOfItems(List superList, List sublist) {
        List<Integer> list = new ArrayList<Integer>(sublist.size());
        for (Object object : sublist) {
            list.add(superList.indexOf(object));
        }// w w  w  .  ja  va  2  s.  c om
        return list;
    }
}

Related

  1. copySubList(final List list, final int fromIndex, final int toIndex)
  2. copySubList(List list, int fromIndex, int toIndex)
  3. divideListInSublistsOfNSize(List list, int n)
  4. getIndexesId(List aList, List aSubList)
  5. getRandomSubList(List inputList, double percentage)
  6. getSubList(int offset, int count, List originalList)
  7. getSubList(List entireList, Class cls)
  8. getSubList(List list, Class type)