Java List Clone cloneProbabilities( List targetProbs)

Here you can find the source of cloneProbabilities( List targetProbs)

Description

clone Probabilities

License

Open Source License

Parameter

Parameter Description
targetProbs a parameter

Declaration

public static ArrayList<Integer> cloneProbabilities(
        List<Integer> targetProbs) 

Method Source Code

//package com.java2s;
import java.util.ArrayList;

import java.util.List;

public class Main {
    /**//from w  ww .  ja v  a  2  s . c  om
     * @param targetProbs
     * @return
     */
    public static ArrayList<Integer> cloneProbabilities(
            List<Integer> targetProbs) {
        if (targetProbs != null && !targetProbs.isEmpty()) {
            ArrayList<Integer> copy = new ArrayList<Integer>(
                    targetProbs.size());
            for (int index = 0; index < targetProbs.size(); index++) {
                copy.add(targetProbs.get(index));
            }
            return copy;
        } else {
            return null;
        }
    }
}

Related

  1. cloneList(List curList)
  2. cloneList(List l)
  3. cloneListExcludingAttribute(String attribute, List attributes)
  4. cloneListOfStrings(List list)
  5. cloneMerchantList(List merchantIDs)
  6. cloneStringList(List list)
  7. cloneStringList(List list)
  8. cloneStringList(List toClone)
  9. cloneToList(final Collection list)