package org.cloudbus.cloudsim.codes.test;

import net.sf.javaml.core.Complex;
import net.sf.javaml.distance.PolynomialKernel;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;

/**
 * ClassName Test4
 * Description
 * Create by HW
 * Date 2021/11/19 9:57
 */
public class Test4 {
    public static void main(String[] args) {
        List list= new ArrayList<>();
        list.add(1);
        list.add(1);
        list.add(1);
        list.add(1);
        System.out.println(list);
        HashMap<String,Double> map=new HashMap<>();
        map.put("up",0.5);
        map.put("right",0.5);
        map.put("down",0.5);
        map.put("left",0.5);
        System.out.println(map.get("up"));
        map.put(String.format("(%d,%d)",1,2),1.0);
        System.out.println(map.get("(1,2)"));
        System.out.println(map);


        List list1=new ArrayList<>();
        list1.add(1);
        list1.add(2);
        list1.add(1);
        list1.add(2);
        list1.add(1);
        list1.add(2);
        System.out.println(list1.getClass());
        list1.sort(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2.compareTo(o1);
            }
        });
        System.out.println(list1);
    }
}
