this.weights = new int[weights.size()]; for (int i = 0; i < weights.size(); i++) this.weights[i] = weights.get(i).intValue();
if (weights.size() == 1) this.weights = new int[]{1}; else { this.weights = new int[weights.size()]; for (int i = 0; i < weights.size(); i++) this.weights[i] = weights.get(i).intValue(); }
    public void set(LinkedList<Integer> weights,             LinkedList<LinkedList<Edge>> dests) {        this.weights = new int[weights.size()];        for (int i = 0; i < weights.size(); i++)            this.weights[i] = weights.get(i).intValue();        //convert the dests list        this.dests = new Edge[dests.size()][];        for (int i = 0; i < dests.size(); i++)             this.dests[i] = dests.get(i).toArray(new Edge[0]);    }